Passed
Push — master ( 051f35...855459 )
by Jonas
21:20 queued 07:19
created

IdeHelperServiceProvider::provides()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Staudenmeir\LaravelAdjacencyList;
4
5
use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
6
use Illuminate\Contracts\Support\DeferrableProvider;
7
use Illuminate\Support\ServiceProvider;
8
use Staudenmeir\LaravelAdjacencyList\IdeHelper\RecursiveRelationsHook;
9
10
class IdeHelperServiceProvider extends ServiceProvider implements DeferrableProvider
11
{
12 6
    public function register(): void
13
    {
14
        /** @var \Illuminate\Contracts\Config\Repository $config */
15 6
        $config = $this->app->get('config');
16
17 6
        $config->set(
18 6
            'ide-helper.model_hooks',
19 6
            array_merge(
20 6
                [RecursiveRelationsHook::class],
21 6
                $config->get('ide-helper.model_hooks', [])
22 6
            )
23 6
        );
24
    }
25
26 6
    public function provides(): array
27
    {
28 6
        return [
29 6
            ModelsCommand::class,
30 6
        ];
31
    }
32
}
33