| 1 | <?php |
||
| 8 | class DeliveryStatus |
||
| 9 | { |
||
| 10 | const STATE_DELIVERED = 'delivered'; |
||
| 11 | |||
| 12 | const STATE_IN_PROGRESS = 'in_progress'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Current preparation state |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $state; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * ExpeditionState constructor. |
||
| 23 | * @param $state |
||
| 24 | */ |
||
| 25 | 15 | protected function __construct($state) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @return string |
||
| 32 | */ |
||
| 33 | 3 | public function __toString() |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @return DeliveryStatus |
||
| 40 | */ |
||
| 41 | 12 | public static function stateDelivered() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return bool |
||
| 48 | */ |
||
| 49 | 9 | public function isDelivered() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @return DeliveryStatus |
||
| 56 | */ |
||
| 57 | 3 | public static function stateInProgress() |
|
| 61 | |||
| 62 | /** |
||
| 63 | * @return bool |
||
| 64 | */ |
||
| 65 | 6 | public function isInProgress() |
|
| 69 | } |
||
| 70 |