ServiceProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 70%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
c 1
b 0
f 0
dl 0
loc 28
ccs 7
cts 10
cp 0.7
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfigPath() 0 3 1
A boot() 0 9 2
A register() 0 4 1
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