GarbageManServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 2
b 0
f 0
nc 1
nop 0
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Spinen\GarbageMan;
4
5
use Illuminate\Support\ServiceProvider;
6
use Spinen\GarbageMan\Commands\PurgeCommand;
7
8
/**
9
 * Class GarbageManServiceProvider
10
 *
11
 * @package Spinen\GarbageMan
12
 */
13
class GarbageManServiceProvider extends ServiceProvider
14
{
15
    /**
16
     * Perform post-registration booting of services.
17
     *
18
     * @return void
19
     */
20 1
    public function boot()
21
    {
22 1
        $this->publishes(
23
            [
24 1
                realpath(__DIR__ . '/config/garbageman.php') => config_path('garbageman.php'),
25
            ],
26 1
            'config'
27
        );
28 1
    }
29
30
    /**
31
     * Register the service provider.
32
     *
33
     * @return void
34
     */
35 1
    public function register()
36
    {
37 1
        $this->app->singleton(
38 1
            'command.garbageman.purge',
39
            function ($app) {
40 1
                return $app->make(PurgeCommand::class);
41 1
            }
42
        );
43
44 1
        $this->commands('command.garbageman.purge');
45 1
    }
46
}
47