Conditions | 3 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | protected static function notInArray($value, array $values, string $message = ''): void |
||
34 | { |
||
35 | if (in_array($value, $values, true)) { |
||
36 | $callable = function (mixed $val) { |
||
37 | return self::valueToString($val); |
||
38 | }; |
||
39 | |||
40 | throw new InvalidArgumentException(sprintf( |
||
41 | $message ?: 'Expected none of: %2$s. Got: %s', |
||
42 | self::valueToString($value), |
||
43 | implode(', ', array_map($callable, $values)), |
||
44 | )); |
||
48 |