Conditions | 7 |
Paths | 6 |
Total Lines | 23 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
46 | public function __invoke(mixed $value, bool $isAttributeMissing): bool |
||
47 | { |
||
48 | if ($isAttributeMissing || $value === null) { |
||
49 | return true; |
||
50 | } |
||
51 | |||
52 | if (is_string($value)) { |
||
53 | if ($this->trimString) { |
||
54 | $value = trim($value); |
||
55 | } |
||
56 | |||
57 | return $value === ''; |
||
58 | } |
||
59 | |||
60 | if (is_iterable($value)) { |
||
61 | foreach ($value as $_item) { |
||
62 | return false; |
||
63 | } |
||
64 | |||
65 | return true; |
||
66 | } |
||
67 | |||
68 | return false; |
||
69 | } |
||
71 |