Conditions | 5 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 5.0488 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 659 | public static function normalize(mixed $skipOnEmpty): ?callable |
|
19 | { |
||
20 | 659 | if ($skipOnEmpty === false || $skipOnEmpty === null) { |
|
21 | 631 | return new SkipNone(); |
|
22 | } |
||
23 | |||
24 | 96 | if ($skipOnEmpty === true) { |
|
25 | 7 | return new SkipOnEmpty(); |
|
26 | } |
||
27 | |||
28 | 93 | if (is_callable($skipOnEmpty)) { |
|
29 | 93 | return $skipOnEmpty; |
|
30 | } |
||
31 | |||
32 | throw new InvalidArgumentException('$skipOnEmpty must be a null, a boolean or a callable.'); |
||
33 | } |
||
35 |