| Total Complexity | 7 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | final class WhenEmpty |
||
| 30 | { |
||
| 31 | public function __construct( |
||
| 32 | /* |
||
| 33 | * @var bool Whether to trim string (both from the start and from the end) before checking. Defaults to `false` |
||
|
|
|||
| 34 | * meaning no trimming is done. |
||
| 35 | */ |
||
| 36 | private bool $trimString = false, |
||
| 37 | ) { |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param mixed $value The validated value. |
||
| 42 | * @param bool $isAttributeMissing A flag defining whether the attribute is missing (not used / not passed at all). |
||
| 43 | * |
||
| 44 | * @return bool Whether the validated value is considered empty. |
||
| 45 | */ |
||
| 46 | public function __invoke(mixed $value, bool $isAttributeMissing): bool |
||
| 53 | } |
||
| 54 | } |
||
| 55 |