Completed
Push — master ( 34b930...ab3e16 )
by Avtandil
05:13
created

LodashServiceProvider::register()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
crap 2
1
<?php
2
/*
3
 * This file is part of the Laravel Lodash package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
declare(strict_types=1);
11
12
namespace Longman\LaravelLodash;
13
14
use Illuminate\Support\ServiceProvider;
15
16
class LodashServiceProvider extends ServiceProvider
17
{
18
    protected $commands = [
19
        'command.lodash.clear-all' => \Longman\LaravelLodash\Commands\ClearAll::class,
20
        'command.lodash.db.clear'  => \Longman\LaravelLodash\Commands\DbClear::class,
21
        'command.lodash.db.dump'   => \Longman\LaravelLodash\Commands\DbDump::class,
22
        'command.lodash.db.restore'   => \Longman\LaravelLodash\Commands\DbRestore::class,
23
        'command.lodash.log.clear' => \Longman\LaravelLodash\Commands\LogClear::class,
24
25
    ];
26
27
28 3
    public function boot()
29
    {
30 3
        $this->publishes([
31 3
            __DIR__ . '/../config/config.php' => config_path('lodash.php'),
32
        ]);
33 3
    }
34
35 3
    public function register()
36
    {
37 3
        foreach ($this->commands as $name => $class) {
38 3
            $this->app->singleton($name, $class);
39
        }
40
41 3
        $this->commands(array_keys($this->commands));
42 3
    }
43
}
44