ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 9
c 2
b 0
f 0
nc 2
nop 0
dl 0
loc 17
ccs 12
cts 12
cp 1
crap 2
rs 9.9666
1
<?php
2
3
namespace SimpleImageManager;
4
5
class ServiceProvider extends \Illuminate\Support\ServiceProvider
6
{
7 20
    public function boot()
8
    {
9 20
        if ($this->app->runningInConsole()) {
10 20
            $this->publishes([
11 20
                __DIR__ . '/../config/simple-image-manager.php' => config_path('simple-image-manager.php'),
12 20
            ], 'config');
13
14 20
            $this->publishes([
15 20
                __DIR__ . '/../resources/views' => resource_path('views/vendor/simple-image-manager'),
16 20
            ], 'views');
17
18 20
            $this->commands([
19 20
                //
20 20
            ]);
21
        }
22
23 20
        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'simple-image-manager');
24
    }
25
26 20
    public function register()
27
    {
28 20
        $this->mergeConfigFrom(__DIR__ . '/../config/simple-image-manager.php', 'simple-image-manager');
29
30 20
        $this->app->bind('simple-image-manager', function ($app) {
31 13
            return new SimpleImageManager($app);
32 20
        });
33
    }
34
}
35