Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 3.0032 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 1 | protected function generateArguments(array $config): array |
|
21 | { |
||
22 | 1 | $parent = parent::generateArguments($config); |
|
23 | 1 | $attributesInteger = ['min', 'max']; |
|
24 | 1 | foreach ($attributesInteger as $attribute) { |
|
25 | 1 | if (!\array_key_exists($attribute, $config)) { |
|
26 | continue; |
||
27 | } |
||
28 | |||
29 | 1 | $config[$attribute] = (int) $config[$attribute]; |
|
30 | } |
||
31 | |||
32 | 1 | $current = [ |
|
33 | 1 | 'max' => $config['max'] ?? null, |
|
34 | 1 | 'min' => $config['min'] ?? null, |
|
35 | 1 | 'minMessage' => $config['min_message'] ?? null, |
|
36 | 1 | 'maxMessage' => $config['max_message'] ?? null, |
|
37 | 1 | ]; |
|
38 | |||
39 | 1 | return array_filter(array_merge($parent, $current)); |
|
40 | } |
||
52 |