Conditions | 5 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
32 | public function errors(): array |
||
33 | { |
||
34 | return array_map(function ($error) { |
||
35 | 6 | $target = array_reduce($error[1] ?? [], function ($carry, $param) { |
|
36 | 5 | if ($carry === null) return $param; |
|
37 | 3 | if (is_numeric($param) &&is_int($param + 0)) { |
|
38 | 3 | return $carry . '[' . $param . ']'; |
|
39 | } |
||
40 | 3 | return $carry . '.' . $param; |
|
41 | 6 | }); |
|
42 | return $error[0] . ($target ? "@{$target}" : ""); |
||
43 | }, $this->errors); |
||
44 | } |
||
45 | } |
||
46 |