ComposerSecurityCheckServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 53
ccs 16
cts 18
cp 0.8889
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 12 1
A register() 0 10 1
A provides() 0 4 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 40
    public function boot()
22
    {
23 40
        $this->publishes([
24 40
            __DIR__ . '/config/composer-security-check.php' => config_path('composer-security-check.php'),
25 40
        ], 'config');
26
27 40
        $this->loadViewsFrom(__DIR__ . '/views', 'composer-security-check');
28
29 40
        $this->publishes([
30 40
            __DIR__ . '/views' => base_path('resources/views/vendor/composer-security-check'),
31 40
        ]);
32 40
    }
33
34
    /**
35
     * Register the service provider.
36
     *
37
     * @return void
38
     */
39 40
    public function register()
40
    {
41 40
        $this->app['command.composer-security:check'] = $this->app->share(
42 16
            function ($app) {
43 16
                return new ComposerSecurityCheck(new client);
44
            }
45 40
        );
46 40
        $this->commands('command.composer-security:check');
47
48 40
    }
49
50
    /**
51
     * Get the services provided by the provider.
52
     *
53
     * @return string[]
54
     */
55
    public function provides()
56
    {
57
        return ['command.composer-security:check'];
58
    }
59
}
60