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

LodashServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 28
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 6 1
A register() 0 8 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