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

SupportServiceProvider   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 3
dl 0
loc 50
ccs 0
cts 23
cp 0
rs 10
c 0
b 0
f 0

4 Methods

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