Completed
Push — master ( 599242...113db7 )
by Joao
03:05
created

supportServiceProvider   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 4
Bugs 0 Features 3
Metric Value
wmc 6
c 4
b 0
f 3
lcom 1
cbo 3
dl 0
loc 73
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 4 1
A register() 0 5 1
A prepareResources() 0 7 1
A registerCommands() 0 4 1
A registerSetupCommand() 0 7 1
A provides() 0 6 1
1
<?php namespace jlourenco\support;
2
3
use Illuminate\Support\ServiceProvider;
4
use jlourenco\support\Commands\SetupCommand;
5
6
class supportServiceProvider extends ServiceProvider
7
{
8
9
    /**
10
     * Perform post-registration booting of services.
11
     *
12
     * @return void
13
     */
14
    public function boot()
15
    {
16
17
    }
18
19
    /**
20
     * Register any package services.
21
     *
22
     * @return void
23
     */
24
    public function register()
25
    {
26
        $this->prepareResources();
27
        $this->registerCommands();
28
    }
29
30
    /**
31
     * Prepare the package resources.
32
     *
33
     * @return void
34
     */
35
    protected function prepareResources()
36
    {
37
        // Publish a config file
38
        $this->publishes([
39
            __DIR__ . '/config' => base_path('/config')
40
        ], 'config');
41
    }
42
43
    /**
44
     * Register the commands.
45
     *
46
     * @return void
47
     */
48
    protected function registerCommands()
49
    {
50
        $this->registerSetupCommand();
51
    }
52
53
    /**
54
     * Register the 'jlourenco:setup' command.
55
     *
56
     * @return void
57
     */
58
    protected function registerSetupCommand()
59
    {
60
        $this->app->singleton('command.jlourenco:setup', function($app) {
0 ignored issues
show
Unused Code introduced by
The parameter $app is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
61
            return new SetupCommand();
62
        });
63
        $this->commands('command.jlourenco:setup');
64
    }
65
66
    /**
67
     * Get the services provided by the provider.
68
     *
69
     * @return array
70
     */
71
    public function provides()
72
    {
73
        return [
74
            'command.jlourenco:setup'
75
        ];
76
    }
77
78
}