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