Total Complexity | 4 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | trait AddsMiddleware |
||
12 | { |
||
13 | /** @var list<list{non-falsy-string, ...}|Closure|Middleware|PsrMiddleware> */ |
||
|
|||
14 | protected array $middleware = []; |
||
15 | |||
16 | /** @psalm-param non-falsy-string|list{non-falsy-string, ...}|Closure|Middleware|PsrMiddleware ...$middleware */ |
||
17 | 44 | public function middleware(string|array|Closure|Middleware|PsrMiddleware ...$middleware): static |
|
18 | { |
||
19 | 44 | $this->middleware = array_merge($this->middleware, array_map(function ($mw) { |
|
20 | 34 | if (is_string($mw)) { |
|
21 | 9 | return [$mw]; |
|
22 | } |
||
23 | |||
24 | 30 | return $mw; |
|
25 | 44 | }, array_values($middleware))); |
|
26 | |||
27 | 44 | return $this; |
|
28 | } |
||
29 | |||
30 | /** @psalm-return list<list{non-falsy-string, ...}|Closure|Middleware|PsrMiddleware> */ |
||
31 | 30 | public function getMiddleware(): array |
|
32 | { |
||
33 | 30 | return $this->middleware; |
|
34 | } |
||
35 | |||
36 | /** @psalm-param list<list{non-falsy-string, ...}|Closure|Middleware|PsrMiddleware> $middleware */ |
||
37 | 2 | public function replaceMiddleware(array $middleware): static |
|
42 | } |
||
43 | } |
||
44 |
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