Conditions | 4 |
Paths | 6 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
66 | 5 | private function validateTraversableList($input): bool |
|
67 | { |
||
68 | 5 | $validate = $this->strict |
|
69 | ? static function ($value) use ($input): bool { |
||
70 | 3 | return $value === $input; |
|
71 | 3 | } |
|
72 | : static function ($value) use ($input): bool { |
||
73 | /** @noinspection TypeUnsafeComparisonInspection */ |
||
74 | 2 | return $value == $input; |
|
75 | 5 | }; |
|
76 | |||
77 | 5 | foreach ($this->list as $item) { |
|
78 | 5 | if ($validate($item)) { |
|
79 | 5 | return true; |
|
80 | } |
||
81 | } |
||
82 | |||
83 | 3 | return false; |
|
84 | } |
||
86 |