Conditions | 5 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function isValid($input, array $context = []): bool |
||
25 | { |
||
26 | if (is_countable($input)) { |
||
27 | return count($input) >= $this->size; |
||
28 | } |
||
29 | |||
30 | if (is_iterable($input)) { |
||
31 | $count = 0; |
||
32 | foreach ($input as $v) { |
||
33 | $count++; |
||
34 | if ($count >= $this->size) { |
||
35 | return true; |
||
36 | } |
||
37 | } |
||
38 | |||
39 | return $count >= $this->size; |
||
40 | } |
||
41 | |||
42 | return false; |
||
43 | } |
||
50 |