SchedulingTasksServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Signifly\SchedulingTasks;
4
5
use Illuminate\Support\ServiceProvider;
6
use Signifly\SchedulingTasks\Commands\TaskMakeCommand;
7
8
class SchedulingTasksServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        if ($this->app->runningInConsole()) {
18
            $this->commands([
19
                TaskMakeCommand::class,
20
            ]);
21
        }
22
    }
23
24
    /**
25
     * Register the service provider.
26
     *
27
     * @return void
28
     */
29
    public function register()
30
    {
31
        $this->app->singleton(TaskLoader::class, function ($app) {
32
            return new TaskLoader($app);
33
        });
34
35
        $this->app->alias(TaskLoader::class, 'task-loader');
36
    }
37
}
38