| @@ 25-44 (lines=20) @@ | ||
| 22 | /** |
|
| 23 | * @package Limoncello\Validation |
|
| 24 | */ |
|
| 25 | final class IsNotNull extends BaseOneValueComparision |
|
| 26 | { |
|
| 27 | /** |
|
| 28 | * Constructor. |
|
| 29 | */ |
|
| 30 | public function __construct() |
|
| 31 | { |
|
| 32 | parent::__construct(null, ErrorCodes::IS_NOT_NULL); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @inheritdoc |
|
| 37 | */ |
|
| 38 | public static function compare($value, ContextInterface $context): bool |
|
| 39 | { |
|
| 40 | $result = $value !== null; |
|
| 41 | ||
| 42 | return $result; |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| @@ 25-44 (lines=20) @@ | ||
| 22 | /** |
|
| 23 | * @package Limoncello\Validation |
|
| 24 | */ |
|
| 25 | final class IsNull extends BaseOneValueComparision |
|
| 26 | { |
|
| 27 | /** |
|
| 28 | * Constructor. |
|
| 29 | */ |
|
| 30 | public function __construct() |
|
| 31 | { |
|
| 32 | parent::__construct(null, ErrorCodes::IS_NULL); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @inheritdoc |
|
| 37 | */ |
|
| 38 | public static function compare($value, ContextInterface $context): bool |
|
| 39 | { |
|
| 40 | $result = $value === null; |
|
| 41 | ||
| 42 | return $result; |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||