SchedulingTasksServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 5 2
A register() 0 7 1
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