Conditions | 4 |
Paths | 6 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace Sample\Validation; |
||
35 | public static function execute($value, ContextInterface $context): array |
||
36 | { |
||
37 | $isValidDeliveryDate = |
||
38 | $value instanceof DateTimeInterface === true && |
||
39 | $value >= new DateTime('tomorrow') && |
||
40 | $value <= new DateTime('+5 days'); |
||
41 | |||
42 | return $isValidDeliveryDate === true ? |
||
43 | static::createSuccessReply($value) : |
||
44 | static::createErrorReply($context, $value, Errors::IS_DELIVERY_DATE); |
||
45 | } |
||
46 | } |
||
47 |