woo-postnl
/
vendor
/
myparcelnl
/
sdk
/
src
/
Adapter
/
DeliveryOptions
/
AbstractShipmentOptionsAdapter.php
AbstractShipmentOptionsAdapter.php in PostNL for WooCommerce 4.4.1, at vendor/myparcelnl/sdk/src/Adapter/DeliveryOptions/AbstractShipmentOptionsAdapter.php
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace MyParcelNL\Sdk\src\Adapter\DeliveryOptions; |
| 4 | |
| 5 | abstract class AbstractShipmentOptionsAdapter |
| 6 | { |
| 7 | /** |
| 8 | * @var bool|null |
| 9 | */ |
| 10 | protected $signature; |
| 11 | |
| 12 | /** |
| 13 | * @var bool|null |
| 14 | */ |
| 15 | protected $only_recipient; |
| 16 | |
| 17 | /** |
| 18 | * @var bool|null |
| 19 | */ |
| 20 | protected $age_check; |
| 21 | |
| 22 | /** |
| 23 | * @var bool|null |
| 24 | */ |
| 25 | protected $large_format; |
| 26 | |
| 27 | /** |
| 28 | * @var bool|null |
| 29 | */ |
| 30 | protected $return; |
| 31 | |
| 32 | /** |
| 33 | * @var int|null |
| 34 | */ |
| 35 | protected $insurance; |
| 36 | |
| 37 | /** |
| 38 | * @var string|null |
| 39 | */ |
| 40 | protected $label_description; |
| 41 | |
| 42 | /** |
| 43 | * @return bool|null |
| 44 | */ |
| 45 | public function hasSignature(): ?bool |
| 46 | { |
| 47 | return $this->signature; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * @return bool|null |
| 52 | */ |
| 53 | public function hasOnlyRecipient(): ?bool |
| 54 | { |
| 55 | return $this->only_recipient; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * @return bool|null |
| 60 | */ |
| 61 | public function hasAgeCheck(): ?bool |
| 62 | { |
| 63 | return $this->age_check; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * @return bool|null |
| 68 | */ |
| 69 | public function hasLargeFormat(): ?bool |
| 70 | { |
| 71 | return $this->large_format; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Return the package if the recipient is not home |
| 76 | * |
| 77 | * @return bool|null |
| 78 | */ |
| 79 | public function isReturn(): ?bool |
| 80 | { |
| 81 | return $this->return; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * @return int|null |
| 86 | */ |
| 87 | public function getInsurance(): ?int |
| 88 | { |
| 89 | return $this->insurance; |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * @return string|null |
| 94 | */ |
| 95 | public function getLabelDescription(): ?string |
| 96 | { |
| 97 | return $this->label_description; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * @return array |
| 102 | */ |
| 103 | public function toArray(): array |
| 104 | { |
| 105 | return [ |
| 106 | 'signature' => $this->hasSignature(), |
| 107 | 'insurance' => $this->getInsurance(), |
| 108 | 'age_check' => $this->hasAgeCheck(), |
| 109 | 'only_recipient' => $this->hasOnlyRecipient(), |
| 110 | 'return' => $this->isReturn(), |
| 111 | 'large_format' => $this->hasLargeFormat(), |
| 112 | 'label_description' => $this->getLabelDescription(), |
| 113 | ]; |
| 114 | } |
| 115 | } |
| 116 |