Conditions | 7 |
Paths | 5 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 7.0671 |
Changes | 0 |
1 | <?php |
||
37 | 18 | public function validate($value): bool |
|
38 | { |
||
39 | 18 | if (!\is_array($value) || 0 === \count($value)) { |
|
40 | return false; |
||
41 | } |
||
42 | |||
43 | 18 | if ($this->isStrictUniqueControl() && \count($value) > \count(\array_unique($value))) { |
|
44 | 2 | return false; |
|
45 | } |
||
46 | |||
47 | 16 | foreach ($value as $item) { |
|
48 | 16 | if (!$this->validator->validate($item)) { |
|
49 | 16 | return false; |
|
50 | } |
||
51 | } |
||
52 | |||
53 | 16 | return true; |
|
54 | } |
||
55 | |||
72 |