Completed
Push — master ( 767580...41593b )
by Elf
22:40 queued 20:07
created

SupportServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 8
Bugs 0 Features 0
Metric Value
c 8
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace ElfSundae\Support;
4
5
use Illuminate\Support\ServiceProvider;
6
7
class SupportServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Bootstrap the service provider.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
        $this->registerCommands();
17
    }
18
19
    /**
20
     * Register the commands for the application.
21
     *
22
     * @return void
23
     */
24
    protected function registerCommands()
25
    {
26
        if ($this->app->runningInConsole()) {
27
            $this->commands([
28
                Console\IdeHelperGenerateCommand::class,
29
            ]);
30
        }
31
    }
32
33
    /**
34
     * Register the service provider.
35
     *
36
     * @return void
37
     */
38
    public function register()
39
    {
40
        $this->registerSupport();
41
    }
42
43
    /**
44
     * Register support singleton.
45
     *
46
     * @return void
47
     */
48
    protected function registerSupport()
49
    {
50
        $this->app->singleton('support', function ($app) {
51
            return new Support($app);
52
        });
53
54
        $this->app->alias('support', Support::class);
55
    }
56
}
57