Completed
Push — master ( 4e9098...833ca6 )
by Alessandro
58:43 queued 55:12
created

ComposerSecurityCheckServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 12
ccs 8
cts 8
cp 1
rs 9.4286
cc 1
eloc 7
nc 1
nop 0
crap 1
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 22
    public function boot()
22
    {
23 22
        $this->publishes([
24 22
            __DIR__ . '/config/composer-security-check.php' => config_path('composer-security-check.php'),
25 22
        ], 'config');
26
27 22
        $this->loadViewsFrom(__DIR__ . '/views', 'composer-security-check');
28
29 22
        $this->publishes([
30 22
            __DIR__ . '/views' => base_path('resource/views/vendor/composer-security-check'),
31
        ]);
32 22
    }
33
34
    /**
35
     * Register the service provider.
36
     *
37
     * @return void
38
     */
39 22
    public function register()
40
    {
41 22
        $this->app['command.composer-security:check'] = $this->app->share(
42 22
            function ($app) {
43 2
                return new ComposerSecurityCheck(new client);
44 22
            }
45
        );
46 22
        $this->commands('command.composer-security:check');
47
48 22
    }
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