• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

orchestral / canvas / 6457267078

09 Oct 2023 01:23PM UTC coverage: 90.985%. Remained the same
6457267078

push

github

crynobone
wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

12 of 12 new or added lines in 7 files covered. (100.0%)

656 of 721 relevant lines covered (90.98%)

27.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.23
/src/LaravelServiceProvider.php
1
<?php
2

3
namespace Orchestra\Canvas;
4

5
use Illuminate\Cache\Console\CacheTableCommand;
6
use Illuminate\Contracts\Support\DeferrableProvider;
7
use Illuminate\Database\Console\Factories\FactoryMakeCommand;
8
use Illuminate\Database\Console\Migrations\MigrateMakeCommand;
9
use Illuminate\Database\Console\Seeds\SeederMakeCommand;
10
use Illuminate\Foundation\Console\CastMakeCommand;
11
use Illuminate\Foundation\Console\ChannelMakeCommand;
12
use Illuminate\Foundation\Console\ComponentMakeCommand;
13
use Illuminate\Foundation\Console\ConsoleMakeCommand;
14
use Illuminate\Foundation\Console\EventMakeCommand;
15
use Illuminate\Foundation\Console\ExceptionMakeCommand;
16
use Illuminate\Foundation\Console\JobMakeCommand;
17
use Illuminate\Foundation\Console\ListenerMakeCommand;
18
use Illuminate\Foundation\Console\MailMakeCommand;
19
use Illuminate\Foundation\Console\ModelMakeCommand;
20
use Illuminate\Foundation\Console\NotificationMakeCommand;
21
use Illuminate\Foundation\Console\ObserverMakeCommand;
22
use Illuminate\Foundation\Console\PolicyMakeCommand;
23
use Illuminate\Foundation\Console\ProviderMakeCommand;
24
use Illuminate\Foundation\Console\RequestMakeCommand;
25
use Illuminate\Foundation\Console\ResourceMakeCommand;
26
use Illuminate\Foundation\Console\RuleMakeCommand;
27
use Illuminate\Foundation\Console\ScopeMakeCommand;
28
use Illuminate\Foundation\Console\TestMakeCommand;
29
use Illuminate\Foundation\Console\ViewMakeCommand;
30
use Illuminate\Notifications\Console\NotificationTableCommand;
31
use Illuminate\Queue\Console\BatchesTableCommand;
32
use Illuminate\Queue\Console\FailedTableCommand;
33
use Illuminate\Queue\Console\TableCommand as QueueTableCommand;
34
use Illuminate\Routing\Console\ControllerMakeCommand;
35
use Illuminate\Routing\Console\MiddlewareMakeCommand;
36
use Illuminate\Session\Console\SessionTableCommand;
37
use Illuminate\Support\ServiceProvider;
38

39
class LaravelServiceProvider extends ServiceProvider implements DeferrableProvider
40
{
41
    /**
42
     * Register the service provider.
43
     *
44
     * @return void
45
     */
46
    public function register()
47
    {
48
        $this->registerCastMakeCommand();
103✔
49
        $this->registerChannelMakeCommand();
103✔
50
        $this->registerComponentMakeCommand();
103✔
51
        $this->registerConsoleMakeCommand();
103✔
52
        $this->registerControllerMakeCommand();
103✔
53
        $this->registerEventMakeCommand();
103✔
54
        $this->registerExceptionMakeCommand();
103✔
55
        $this->registerFactoryMakeCommand();
103✔
56
        $this->registerJobMakeCommand();
103✔
57
        $this->registerListenerMakeCommand();
103✔
58
        $this->registerMailMakeCommand();
103✔
59
        $this->registerMiddlewareMakeCommand();
103✔
60
        $this->registerMigrateMakeCommand();
103✔
61
        $this->registerModelMakeCommand();
103✔
62
        $this->registerNotificationMakeCommand();
103✔
63
        $this->registerObserverMakeCommand();
103✔
64
        $this->registerPolicyMakeCommand();
103✔
65
        $this->registerProviderMakeCommand();
103✔
66
        $this->registerRequestMakeCommand();
103✔
67
        $this->registerResourceMakeCommand();
103✔
68
        $this->registerRuleMakeCommand();
103✔
69
        $this->registerScopeMakeCommand();
103✔
70
        $this->registerSeederMakeCommand();
103✔
71
        $this->registerTestMakeCommand();
103✔
72
        $this->registerViewMakeCommand();
103✔
73

74
        $this->registerCacheTableCommand();
103✔
75
        $this->registerNotificationTableCommand();
103✔
76
        $this->registerQueueBatchesTableCommand();
103✔
77
        $this->registerQueueFailedTableCommand();
103✔
78
        $this->registerQueueTableCommand();
103✔
79
        $this->registerSessionTableCommand();
103✔
80

81
        $this->registerUserFactoryMakeCommand();
103✔
82
        $this->registerUserModelMakeCommand();
103✔
83

84
        $this->commands([
103✔
85
            Console\CastMakeCommand::class,
103✔
86
            Console\ChannelMakeCommand::class,
103✔
87
            Console\ComponentMakeCommand::class,
103✔
88
            Console\ConsoleMakeCommand::class,
103✔
89
            Console\ControllerMakeCommand::class,
103✔
90
            Console\EventMakeCommand::class,
103✔
91
            Console\ExceptionMakeCommand::class,
103✔
92
            Console\FactoryMakeCommand::class,
103✔
93
            Console\JobMakeCommand::class,
103✔
94
            Console\ListenerMakeCommand::class,
103✔
95
            Console\MailMakeCommand::class,
103✔
96
            Console\MiddlewareMakeCommand::class,
103✔
97
            Console\MigrateMakeCommand::class,
103✔
98
            Console\ModelMakeCommand::class,
103✔
99
            Console\NotificationMakeCommand::class,
103✔
100
            Console\ObserverMakeCommand::class,
103✔
101
            Console\PolicyMakeCommand::class,
103✔
102
            Console\ProviderMakeCommand::class,
103✔
103
            Console\RequestMakeCommand::class,
103✔
104
            Console\ResourceMakeCommand::class,
103✔
105
            Console\RuleMakeCommand::class,
103✔
106
            Console\ScopeMakeCommand::class,
103✔
107
            Console\SeederMakeCommand::class,
103✔
108
            Console\TestMakeCommand::class,
103✔
109
            Console\ViewMakeCommand::class,
103✔
110

111
            Console\BatchesTableCommand::class,
103✔
112
            Console\CacheTableCommand::class,
103✔
113
            Console\FailedTableCommand::class,
103✔
114
            Console\NotificationTableCommand::class,
103✔
115
            Console\QueueTableCommand::class,
103✔
116
            Console\SessionTableCommand::class,
103✔
117

118
            Console\UserFactoryMakeCommand::class,
103✔
119
            Console\UserModelMakeCommand::class,
103✔
120
        ]);
103✔
121
    }
122

123
    /**
124
     * Register the command.
125
     *
126
     * @return void
127
     */
128
    protected function registerCastMakeCommand()
129
    {
130
        $this->app->singleton(CastMakeCommand::class, static function ($app) {
103✔
131
            return new Console\CastMakeCommand($app['files']);
×
132
        });
103✔
133
    }
134

135
    /**
136
     * Register the command.
137
     *
138
     * @return void
139
     */
140
    protected function registerChannelMakeCommand()
141
    {
142
        $this->app->singleton(ChannelMakeCommand::class, static function ($app) {
103✔
143
            return new Console\ChannelMakeCommand($app['files']);
×
144
        });
103✔
145
    }
146

147
    /**
148
     * Register the command.
149
     *
150
     * @return void
151
     */
152
    protected function registerComponentMakeCommand()
153
    {
154
        $this->app->singleton(ComponentMakeCommand::class, static function ($app) {
103✔
155
            return new Console\ComponentMakeCommand($app['files']);
×
156
        });
103✔
157
    }
158

159
    /**
160
     * Register the command.
161
     *
162
     * @return void
163
     */
164
    protected function registerConsoleMakeCommand()
165
    {
166
        $this->app->singleton(ConsoleMakeCommand::class, static function ($app) {
103✔
167
            return new Console\ConsoleMakeCommand($app['files']);
×
168
        });
103✔
169
    }
170

171
    /**
172
     * Register the command.
173
     *
174
     * @return void
175
     */
176
    protected function registerControllerMakeCommand()
177
    {
178
        $this->app->singleton(ControllerMakeCommand::class, static function ($app) {
103✔
179
            return new Console\ControllerMakeCommand($app['files']);
×
180
        });
103✔
181
    }
182

183
    /**
184
     * Register the command.
185
     *
186
     * @return void
187
     */
188
    protected function registerEventMakeCommand()
189
    {
190
        $this->app->singleton(EventMakeCommand::class, static function ($app) {
103✔
191
            return new Console\EventMakeCommand($app['files']);
×
192
        });
103✔
193
    }
194

195
    /**
196
     * Register the command.
197
     *
198
     * @return void
199
     */
200
    protected function registerExceptionMakeCommand()
201
    {
202
        $this->app->singleton(ExceptionMakeCommand::class, static function ($app) {
103✔
203
            return new Console\ExceptionMakeCommand($app['files']);
×
204
        });
103✔
205
    }
206

207
    /**
208
     * Register the command.
209
     *
210
     * @return void
211
     */
212
    protected function registerFactoryMakeCommand()
213
    {
214
        $this->app->singleton(FactoryMakeCommand::class, static function ($app) {
103✔
215
            return new Console\FactoryMakeCommand($app['files']);
×
216
        });
103✔
217
    }
218

219
    /**
220
     * Register the command.
221
     *
222
     * @return void
223
     */
224
    protected function registerJobMakeCommand()
225
    {
226
        $this->app->singleton(JobMakeCommand::class, static function ($app) {
103✔
227
            return new Console\JobMakeCommand($app['files']);
×
228
        });
103✔
229
    }
230

231
    /**
232
     * Register the command.
233
     *
234
     * @return void
235
     */
236
    protected function registerListenerMakeCommand()
237
    {
238
        $this->app->singleton(ListenerMakeCommand::class, static function ($app) {
103✔
239
            return new Console\ListenerMakeCommand($app['files']);
×
240
        });
103✔
241
    }
242

243
    /**
244
     * Register the command.
245
     *
246
     * @return void
247
     */
248
    protected function registerMailMakeCommand()
249
    {
250
        $this->app->singleton(MailMakeCommand::class, static function ($app) {
103✔
251
            return new Console\MailMakeCommand($app['files']);
×
252
        });
103✔
253
    }
254

255
    /**
256
     * Register the command.
257
     *
258
     * @return void
259
     */
260
    protected function registerMiddlewareMakeCommand()
261
    {
262
        $this->app->singleton(MiddlewareMakeCommand::class, static function ($app) {
103✔
263
            return new Console\MiddlewareMakeCommand($app['files']);
×
264
        });
103✔
265
    }
266

267
    /**
268
     * Register the command.
269
     *
270
     * @return void
271
     */
272
    protected function registerMigrateMakeCommand()
273
    {
274
        $this->app->singleton(MigrateMakeCommand::class, static function ($app) {
103✔
275
            // Once we have the migration creator registered, we will create the command
276
            // and inject the creator. The creator is responsible for the actual file
277
            // creation of the migrations, and may be extended by these developers.
278
            $creator = $app['migration.creator'];
101✔
279

280
            $composer = $app['composer'];
101✔
281

282
            return new Console\MigrateMakeCommand($creator, $composer);
101✔
283
        });
103✔
284
    }
285

286
    /**
287
     * Register the command.
288
     *
289
     * @return void
290
     */
291
    protected function registerModelMakeCommand()
292
    {
293
        $this->app->singleton(ModelMakeCommand::class, static function ($app) {
103✔
294
            return new Console\ModelMakeCommand($app['files']);
×
295
        });
103✔
296
    }
297

298
    /**
299
     * Register the command.
300
     *
301
     * @return void
302
     */
303
    protected function registerNotificationMakeCommand()
304
    {
305
        $this->app->singleton(NotificationMakeCommand::class, static function ($app) {
103✔
306
            return new Console\NotificationMakeCommand($app['files']);
×
307
        });
103✔
308
    }
309

310
    /**
311
     * Register the command.
312
     *
313
     * @return void
314
     */
315
    protected function registerObserverMakeCommand()
316
    {
317
        $this->app->singleton(ObserverMakeCommand::class, static function ($app) {
103✔
318
            return new Console\ObserverMakeCommand($app['files']);
×
319
        });
103✔
320
    }
321

322
    /**
323
     * Register the command.
324
     *
325
     * @return void
326
     */
327
    protected function registerPolicyMakeCommand()
328
    {
329
        $this->app->singleton(PolicyMakeCommand::class, static function ($app) {
103✔
330
            return new Console\PolicyMakeCommand($app['files']);
×
331
        });
103✔
332
    }
333

334
    /**
335
     * Register the command.
336
     *
337
     * @return void
338
     */
339
    protected function registerProviderMakeCommand()
340
    {
341
        $this->app->singleton(ProviderMakeCommand::class, static function ($app) {
103✔
342
            return new Console\ProviderMakeCommand($app['files']);
×
343
        });
103✔
344
    }
345

346
    /**
347
     * Register the command.
348
     *
349
     * @return void
350
     */
351
    protected function registerRequestMakeCommand()
352
    {
353
        $this->app->singleton(RequestMakeCommand::class, static function ($app) {
103✔
354
            return new Console\RequestMakeCommand($app['files']);
×
355
        });
103✔
356
    }
357

358
    /**
359
     * Register the command.
360
     *
361
     * @return void
362
     */
363
    protected function registerResourceMakeCommand()
364
    {
365
        $this->app->singleton(ResourceMakeCommand::class, static function ($app) {
103✔
366
            return new Console\ResourceMakeCommand($app['files']);
×
367
        });
103✔
368
    }
369

370
    /**
371
     * Register the command.
372
     *
373
     * @return void
374
     */
375
    protected function registerRuleMakeCommand()
376
    {
377
        $this->app->singleton(RuleMakeCommand::class, static function ($app) {
103✔
378
            return new Console\RuleMakeCommand($app['files']);
×
379
        });
103✔
380
    }
381

382
    /**
383
     * Register the command.
384
     *
385
     * @return void
386
     */
387
    protected function registerScopeMakeCommand()
388
    {
389
        $this->app->singleton(ScopeMakeCommand::class, static function ($app) {
103✔
390
            return new Console\ScopeMakeCommand($app['files']);
×
391
        });
103✔
392
    }
393

394
    /**
395
     * Register the command.
396
     *
397
     * @return void
398
     */
399
    protected function registerSeederMakeCommand()
400
    {
401
        $this->app->singleton(SeederMakeCommand::class, static function ($app) {
103✔
402
            return new Console\SeederMakeCommand($app['files']);
×
403
        });
103✔
404
    }
405

406
    /**
407
     * Register the command.
408
     *
409
     * @return void
410
     */
411
    protected function registerTestMakeCommand()
412
    {
413
        $this->app->singleton(TestMakeCommand::class, static function ($app) {
103✔
414
            return new Console\TestMakeCommand($app['files']);
×
415
        });
103✔
416
    }
417

418
    /**
419
     * Register the command.
420
     *
421
     * @return void
422
     */
423
    protected function registerViewMakeCommand()
424
    {
425
        $this->app->singleton(ViewMakeCommand::class, static function ($app) {
103✔
426
            return new Console\ViewMakeCommand($app['files']);
×
427
        });
103✔
428
    }
429

430
    /**
431
     * Register the command.
432
     *
433
     * @return void
434
     */
435
    protected function registerCacheTableCommand()
436
    {
437
        $this->app->singleton(CacheTableCommand::class, static function ($app) {
103✔
438
            return new Console\CacheTableCommand($app['files']);
×
439
        });
103✔
440
    }
441

442
    /**
443
     * Register the command.
444
     *
445
     * @return void
446
     */
447
    protected function registerNotificationTableCommand()
448
    {
449
        $this->app->singleton(NotificationTableCommand::class, static function ($app) {
103✔
450
            return new Console\NotificationTableCommand($app['files']);
×
451
        });
103✔
452
    }
453

454
    /**
455
     * Register the command.
456
     *
457
     * @return void
458
     */
459
    protected function registerQueueBatchesTableCommand()
460
    {
461
        $this->app->singleton(BatchesTableCommand::class, static function ($app) {
103✔
462
            return new Console\BatchesTableCommand($app['files']);
×
463
        });
103✔
464
    }
465

466
    /**
467
     * Register the command.
468
     *
469
     * @return void
470
     */
471
    protected function registerQueueFailedTableCommand()
472
    {
473
        $this->app->singleton(FailedTableCommand::class, static function ($app) {
103✔
474
            return new Console\FailedTableCommand($app['files']);
×
475
        });
103✔
476
    }
477

478
    /**
479
     * Register the command.
480
     *
481
     * @return void
482
     */
483
    protected function registerQueueTableCommand()
484
    {
485
        $this->app->singleton(QueueTableCommand::class, static function ($app) {
103✔
486
            return new Console\QueueTableCommand($app['files']);
×
487
        });
103✔
488
    }
489

490
    /**
491
     * Register the command.
492
     *
493
     * @return void
494
     */
495
    protected function registerSessionTableCommand()
496
    {
497
        $this->app->singleton(SessionTableCommand::class, static function ($app) {
103✔
498
            return new Console\SessionTableCommand($app['files']);
×
499
        });
103✔
500
    }
501

502
    /**
503
     * Register the command.
504
     *
505
     * @return void
506
     */
507
    protected function registerUserFactoryMakeCommand()
508
    {
509
        $this->app->singleton(Console\UserFactoryMakeCommand::class, static function ($app) {
103✔
510
            return new Console\UserFactoryMakeCommand($app['files']);
1✔
511
        });
103✔
512
    }
513

514
    /**
515
     * Register the command.
516
     *
517
     * @return void
518
     */
519
    protected function registerUserModelMakeCommand()
520
    {
521
        $this->app->singleton(Console\UserModelMakeCommand::class, static function ($app) {
103✔
522
            return new Console\UserModelMakeCommand($app['files']);
1✔
523
        });
103✔
524
    }
525

526
    /**
527
     * Get the services provided by the provider.
528
     *
529
     * @return array
530
     */
531
    public function provides()
532
    {
533
        return [
1✔
534
            CastMakeCommand::class,
1✔
535
            Console\CastMakeCommand::class,
1✔
536
            ChannelMakeCommand::class,
1✔
537
            Console\ChannelMakeCommand::class,
1✔
538
            ComponentMakeCommand::class,
1✔
539
            Console\ComponentMakeCommand::class,
1✔
540
            ConsoleMakeCommand::class,
1✔
541
            Console\ConsoleMakeCommand::class,
1✔
542
            ControllerMakeCommand::class,
1✔
543
            Console\ControllerMakeCommand::class,
1✔
544
            EventMakeCommand::class,
1✔
545
            Console\EventMakeCommand::class,
1✔
546
            ExceptionMakeCommand::class,
1✔
547
            Console\ExceptionMakeCommand::class,
1✔
548
            FactoryMakeCommand::class,
1✔
549
            Console\FactoryMakeCommand::class,
1✔
550
            JobMakeCommand::class,
1✔
551
            Console\JobMakeCommand::class,
1✔
552
            ListenerMakeCommand::class,
1✔
553
            Console\ListenerMakeCommand::class,
1✔
554
            MailMakeCommand::class,
1✔
555
            Console\MailMakeCommand::class,
1✔
556
            MiddlewareMakeCommand::class,
1✔
557
            Console\MiddlewareMakeCommand::class,
1✔
558
            MigrateMakeCommand::class,
1✔
559
            Console\MigrateMakeCommand::class,
1✔
560
            ModelMakeCommand::class,
1✔
561
            Console\ModelMakeCommand::class,
1✔
562
            NotificationMakeCommand::class,
1✔
563
            Console\NotificationMakeCommand::class,
1✔
564
            ObserverMakeCommand::class,
1✔
565
            Console\ObserverMakeCommand::class,
1✔
566
            PolicyMakeCommand::class,
1✔
567
            Console\PolicyMakeCommand::class,
1✔
568
            ProviderMakeCommand::class,
1✔
569
            Console\ProviderMakeCommand::class,
1✔
570
            RequestMakeCommand::class,
1✔
571
            Console\RequestMakeCommand::class,
1✔
572
            ResourceMakeCommand::class,
1✔
573
            Console\ResourceMakeCommand::class,
1✔
574
            RuleMakeCommand::class,
1✔
575
            Console\RuleMakeCommand::class,
1✔
576
            ScopeMakeCommand::class,
1✔
577
            Console\ScopeMakeCommand::class,
1✔
578
            SeederMakeCommand::class,
1✔
579
            Console\SeederMakeCommand::class,
1✔
580
            TestMakeCommand::class,
1✔
581
            Console\TestMakeCommand::class,
1✔
582
            ViewMakeCommand::class,
1✔
583
            Console\ViewMakeCommand::class,
1✔
584

585
            BatchesTableCommand::class,
1✔
586
            Console\BatchesTableCommand::class,
1✔
587
            CacheTableCommand::class,
1✔
588
            Console\CacheTableCommand::class,
1✔
589
            FailedTableCommand::class,
1✔
590
            Console\FailedTableCommand::class,
1✔
591
            NotificationTableCommand::class,
1✔
592
            Console\NotificationTableCommand::class,
1✔
593
            QueueTableCommand::class,
1✔
594
            Console\QueueTableCommand::class,
1✔
595
            SessionTableCommand::class,
1✔
596
            Console\SessionTableCommand::class,
1✔
597

598
            Console\UserFactoryMakeCommand::class,
1✔
599
            Console\UserModelMakeCommand::class,
1✔
600
        ];
1✔
601
    }
602
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc