ShieldServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Shield\Shield\Providers;
4
5
use Illuminate\Support\ServiceProvider;
6
use Shield\Shield\Http\Middleware\Shield;
7
8
/**
9
 * Class ShieldServiceProvider
10
 *
11
 * @package \Shield\Shield\Providers
12
 */
13
class ShieldServiceProvider extends ServiceProvider
14
{
15 10
    public function boot()
16
    {
17 10
        $this->publishes([
18 10
            __DIR__ . '/../../resources/config/shield.php' => config_path('shield.php'),
19 10
        ], 'config');
20
21 10
        $this->app['router']->aliasMiddleware('shield', Shield::class);
22 10
    }
23
24 10
    public function register()
25
    {
26 10
        $this->mergeConfigFrom(
27 10
            __DIR__ . '/../../resources/config/shield.php',
28 10
            'shield'
29
        );
30 10
    }
31
}
32