ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0185

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 9
ccs 5
cts 6
cp 0.8333
rs 10
cc 2
nc 2
nop 0
crap 2.0185
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Noitran\Repositories;
6
7
use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;
8
use Noitran\Repositories\Contracts\Filter\FilterStrategy;
0 ignored issues
show
Bug introduced by
The type Noitran\Repositories\Con...s\Filter\FilterStrategy was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
/**
11
 * Class ServiceProvider.
12
 */
13
class ServiceProvider extends IlluminateServiceProvider
14
{
15
    /**
16
     * @return string
17
     */
18
    protected function getConfigPath(): string
19
    {
20
        return __DIR__ . '/../config/repositories.php';
21
    }
22
23 35
    public function boot(): void
24
    {
25 35
        $configPath = __DIR__ . '/../config/repositories.php';
26 35
        if (\function_exists('config_path')) {
27 35
            $publishPath = config_path('repositories.php');
28
        } else {
29
            $publishPath = base_path('config/repositories.php');
30
        }
31 35
        $this->publishes([$configPath => $publishPath], 'config');
32 35
    }
33
34
    /**
35
     * Register the service provider.
36
     */
37
    public function register(): void
38
    {
39 35
        $configPath = __DIR__ . '/../config/repositories.php';
40
        $this->mergeConfigFrom($configPath, 'repositories');
41 35
42 35
        // $this->registerFilter();
43 35
    }
44
45
//    protected function registerFilter(): void
46
//    {
47
//        $this->app->bind(FilterStrategy::class, )
48
//    }
49
}
50