Conditions | 6 |
Paths | 1 |
Total Lines | 28 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 14.5383 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | 1 | public static function get() : array { |
|
16 | 1 | return [ |
|
17 | 1 | '{' => [ |
|
18 | 1 | 'match' => 'any', |
|
19 | 1 | 'categories' => function (string $value) : ?array { |
|
20 | 1 | if (($start = \mb_strpos($value, '{')) === false) { |
|
21 | |||
22 | 1 | } elseif (($end = \mb_strpos($value, '}', $start)) !== false) { |
|
23 | $json = \mb_substr($value, $start, $end - $start + 1); |
||
24 | |||
25 | // decode JSON |
||
26 | if (($data = \json_decode($json, true)) !== null) { |
||
27 | $data = \array_change_key_case((array) $data); |
||
28 | $mappings = [ |
||
29 | 'os' => 'platform', |
||
30 | 'osversion' => 'platformversion' |
||
31 | ]; |
||
32 | $fields = ['os', 'osversion', 'platform', 'platformversion', 'app', 'appversion']; |
||
33 | $cat = []; |
||
34 | foreach ($fields AS $item) { |
||
35 | if (isset($data[$item])) { |
||
36 | $cat[$mappings[$item] ?? $item] = $data[$item]; |
||
37 | } |
||
38 | } |
||
39 | return $cat; |
||
40 | } |
||
41 | } |
||
42 | 1 | return null; |
|
43 | 1 | } |
|
47 | } |
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