Total Complexity | 6 |
Total Lines | 68 |
Duplicated Lines | 0 % |
Coverage | 85.71% |
Changes | 0 |
1 | <?php |
||
13 | class DependencyProvider implements DependencyProviderInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var \Xervice\Core\Config\ConfigInterface |
||
17 | */ |
||
18 | private $config; |
||
19 | |||
20 | /** |
||
21 | * @var callable[] |
||
22 | */ |
||
23 | private $container; |
||
24 | |||
25 | /** |
||
26 | * DependencyProvider constructor. |
||
27 | * |
||
28 | * @param \Xervice\Core\Config\ConfigInterface $config |
||
29 | */ |
||
30 | 7 | public function __construct(ConfigInterface $config) |
|
31 | { |
||
32 | 7 | $this->config = $config; |
|
33 | 7 | } |
|
34 | |||
35 | |||
36 | /** |
||
37 | * @param string $name |
||
38 | * @param callable $function |
||
39 | * |
||
40 | * @return \Xervice\Core\Dependency\DependencyProviderInterface |
||
41 | */ |
||
42 | 1 | public function set(string $name, callable $function): DependencyProviderInterface |
|
43 | { |
||
44 | 1 | $this->container[$name] = $function; |
|
45 | |||
46 | 1 | return $this; |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param string $name |
||
51 | * |
||
52 | * @return mixed |
||
53 | */ |
||
54 | 1 | public function get(string $name) |
|
55 | { |
||
56 | 1 | return $this->container[$name](); |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * @return \Xervice\Core\Config\ConfigInterface |
||
61 | */ |
||
62 | 1 | public function getConfig(): ConfigInterface |
|
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return \Generated\Ide\LocatorAutoComplete|\Xervice\Core\Locator\Locator |
||
|
|||
69 | */ |
||
70 | public function getLocator(): Locator |
||
71 | { |
||
72 | return Locator::getInstance(); |
||
73 | } |
||
74 | |||
75 | /** |
||
76 | * @param \Xervice\Core\Dependency\Provider\ProviderInterface $provider |
||
77 | */ |
||
78 | 1 | public function register(ProviderInterface $provider): void |
|
81 | 1 | } |
|
82 | |||
83 | |||
84 | } |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths