Completed
Push — master ( 7c7f7e...73f7b4 )
by Alessandro
13:16
created

ComposerSecurityCheckServiceProvider::provides()   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 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
namespace Padosoft\LaravelComposerSecurity;
3
4
use Illuminate\Support\ServiceProvider;
5
use GuzzleHttp\Client;
6
7
class ComposerSecurityCheckServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Indicates if loading of the provider is deferred.
11
     *
12
     * @var bool
13
     */
14
    protected $defer = true;
15
16
    /**
17
     * Bootstrap the application events.
18
     *
19
     * @return void
20
     */
21 28
    public function boot()
22
    {
23 28
        $this->publishes([
24 28
            __DIR__ . '/config/composer-security-check.php' => config_path('composer-security-check.php'),
25 28
        ], 'config');
26
27 28
        $this->loadViewsFrom(__DIR__ . '/views', 'composer-security-check');
28
29 28
        $this->publishes([
30 28
            __DIR__ . '/views' => base_path('resource/views/vendor/composer-security-check'),
31 28
        ]);
32 28
    }
33
34
    /**
35
     * Register the service provider.
36
     *
37
     * @return void
38
     */
39 28
    public function register()
40
    {
41 28
        $this->app['command.composer-security:check'] = $this->app->share(
42 8
            function ($app) {
43 8
                return new ComposerSecurityCheck(new client);
44
            }
45 28
        );
46 28
        $this->commands('command.composer-security:check');
47
48 28
    }
49
50
    /**
51
     * Get the services provided by the provider.
52
     *
53
     * @return array
54
     */
55
    public function provides()
56
    {
57
        return ['command.composer-security:check'];
58
    }
59
}
60