@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @return string |
| 33 | 33 | * @throws InvalidAttributeException |
| 34 | 34 | */ |
| 35 | - public function getObjectPurpose() |
|
| 35 | + public function getObjectPurpose () |
|
| 36 | 36 | { |
| 37 | 37 | $allowed = [static::OBJECT_PURPOSE_QUOTE, static::OBJECT_PURPOSE_PURCHASE]; |
| 38 | 38 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @return string |
| 50 | 50 | * @throws InvalidAttributeException |
| 51 | 51 | */ |
| 52 | - public function getName() |
|
| 52 | + public function getName () |
|
| 53 | 53 | { |
| 54 | 54 | if ($this->getObjectPurpose() === static::OBJECT_PURPOSE_PURCHASE) { |
| 55 | 55 | return $this->attributes->mustHave('name')->asString(); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @return string |
| 66 | 66 | */ |
| 67 | - public function getCompany() |
|
| 67 | + public function getCompany () |
|
| 68 | 68 | { |
| 69 | 69 | return $this->attributes->mayHave('company')->asString(); |
| 70 | 70 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @return string |
| 79 | 79 | * @throws InvalidAttributeException |
| 80 | 80 | */ |
| 81 | - public function getStreet1() |
|
| 81 | + public function getStreet1 () |
|
| 82 | 82 | { |
| 83 | 83 | if ($this->getObjectPurpose() === static::OBJECT_PURPOSE_PURCHASE) { |
| 84 | 84 | return $this->attributes->mustHave('street1')->asString(); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * |
| 95 | 95 | * @return string |
| 96 | 96 | */ |
| 97 | - public function getStreetNo() |
|
| 97 | + public function getStreetNo () |
|
| 98 | 98 | { |
| 99 | 99 | return $this->attributes->mayHave('street_no')->asString(); |
| 100 | 100 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * |
| 107 | 107 | * @return string |
| 108 | 108 | */ |
| 109 | - public function getStreet2() |
|
| 109 | + public function getStreet2 () |
|
| 110 | 110 | { |
| 111 | 111 | return $this->attributes->mayHave('street2')->asString(); |
| 112 | 112 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * @return string |
| 122 | 122 | * @throws InvalidAttributeException |
| 123 | 123 | */ |
| 124 | - public function getCity() |
|
| 124 | + public function getCity () |
|
| 125 | 125 | { |
| 126 | 126 | if ($this->getObjectPurpose() === static::OBJECT_PURPOSE_PURCHASE) { |
| 127 | 127 | return $this->attributes->mustHave('city')->asString(); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | * @return string |
| 139 | 139 | * @throws InvalidAttributeException |
| 140 | 140 | */ |
| 141 | - public function getZip() |
|
| 141 | + public function getZip () |
|
| 142 | 142 | { |
| 143 | 143 | if ($this->getObjectPurpose() === static::OBJECT_PURPOSE_PURCHASE) { |
| 144 | 144 | return $this->attributes->mustHave('zip')->asString(); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * @return string |
| 157 | 157 | * @throws InvalidAttributeException |
| 158 | 158 | */ |
| 159 | - public function getState() |
|
| 159 | + public function getState () |
|
| 160 | 160 | { |
| 161 | 161 | if (in_array($this->getCountry(), ['US', 'CA'], true)) { |
| 162 | 162 | return $this->attributes->mustHave('state')->asString(); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | * @return string |
| 175 | 175 | * @throws InvalidAttributeException |
| 176 | 176 | */ |
| 177 | - public function getCountry() |
|
| 177 | + public function getCountry () |
|
| 178 | 178 | { |
| 179 | 179 | return $this->attributes->mustHave('country')->asString(function ($country) { |
| 180 | 180 | return (bool)preg_match('/^[A-Z]{2}$/', $country); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | * @return string |
| 191 | 191 | * @throws InvalidAttributeException |
| 192 | 192 | */ |
| 193 | - public function getPhone() |
|
| 193 | + public function getPhone () |
|
| 194 | 194 | { |
| 195 | 195 | return $this->attributes->mayHave('phone')->asString(); |
| 196 | 196 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | * @return string |
| 204 | 204 | * @throws InvalidAttributeException |
| 205 | 205 | */ |
| 206 | - public function getEmail() |
|
| 206 | + public function getEmail () |
|
| 207 | 207 | { |
| 208 | 208 | $validation = function ($email) { |
| 209 | 209 | return filter_var($email, FILTER_VALIDATE_EMAIL); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | * |
| 222 | 222 | * @return null|bool |
| 223 | 223 | */ |
| 224 | - public function getIsResidential() |
|
| 224 | + public function getIsResidential () |
|
| 225 | 225 | { |
| 226 | 226 | $is_residential = $this->attributes->mayHave('is_residential')->value(); |
| 227 | 227 | if ($is_residential === null) { |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | return (bool)$is_residential; |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - public function toArray() |
|
| 234 | + public function toArray () |
|
| 235 | 235 | { |
| 236 | 236 | return array_filter($this->__toArray()); |
| 237 | 237 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * @param Rate[] $entities |
| 9 | 9 | */ |
| 10 | - public function __construct(array $entities) |
|
| 10 | + public function __construct (array $entities) |
|
| 11 | 11 | { |
| 12 | 12 | parent::__construct($entities); |
| 13 | 13 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * @param Transaction[] $entities |
| 9 | 9 | */ |
| 10 | - public function __construct(array $entities) |
|
| 10 | + public function __construct (array $entities) |
|
| 11 | 11 | { |
| 12 | 12 | parent::__construct($entities); |
| 13 | 13 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @return mixed|null |
| 50 | 50 | */ |
| 51 | - public function getAvailableShippo() |
|
| 51 | + public function getAvailableShippo () |
|
| 52 | 52 | { |
| 53 | 53 | return $this->attributes->mayHave('available_shippo')->value(); |
| 54 | 54 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * |
| 59 | 59 | * @return mixed|null |
| 60 | 60 | */ |
| 61 | - public function getOutboundEndpoint() |
|
| 61 | + public function getOutboundEndpoint () |
|
| 62 | 62 | { |
| 63 | 63 | return $this->attributes->mayHave('outbound_endpoint')->value(); |
| 64 | 64 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * |
| 69 | 69 | * @return mixed|null |
| 70 | 70 | */ |
| 71 | - public function getInboundEndpoint() |
|
| 71 | + public function getInboundEndpoint () |
|
| 72 | 72 | { |
| 73 | 73 | return $this->attributes->mayHave('inbound_endpoint')->value(); |
| 74 | 74 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @return mixed|null |
| 80 | 80 | */ |
| 81 | - public function getArrivesBy() |
|
| 81 | + public function getArrivesBy () |
|
| 82 | 82 | { |
| 83 | 83 | return $this->attributes->mayHave('arrives_by')->value(); |
| 84 | 84 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * |
| 89 | 89 | * @return mixed|null |
| 90 | 90 | */ |
| 91 | - public function getDeliveryAttempts() |
|
| 91 | + public function getDeliveryAttempts () |
|
| 92 | 92 | { |
| 93 | 93 | return $this->attributes->mayHave('delivery_attempts')->value(); |
| 94 | 94 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * @param Parcel[] $entities |
| 9 | 9 | */ |
| 10 | - public function __construct(array $entities) |
|
| 10 | + public function __construct (array $entities) |
|
| 11 | 11 | { |
| 12 | 12 | parent::__construct($entities); |
| 13 | 13 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | * |
| 20 | 20 | * @return string |
| 21 | 21 | */ |
| 22 | - public function getObjectStatus() |
|
| 22 | + public function getObjectStatus () |
|
| 23 | 23 | { |
| 24 | 24 | return $this->attributes->mayHave('object_status')->asString(); |
| 25 | 25 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * @param Refund[] $entities |
| 9 | 9 | */ |
| 10 | - public function __construct(array $entities) |
|
| 10 | + public function __construct (array $entities) |
|
| 11 | 11 | { |
| 12 | 12 | parent::__construct($entities); |
| 13 | 13 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * @param Shipment[] $entities |
| 9 | 9 | */ |
| 10 | - public function __construct(array $entities) |
|
| 10 | + public function __construct (array $entities) |
|
| 11 | 11 | { |
| 12 | 12 | parent::__construct($entities); |
| 13 | 13 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * |
| 20 | 20 | * @return \DateTime |
| 21 | 21 | */ |
| 22 | - public function getObjectCreated() |
|
| 22 | + public function getObjectCreated () |
|
| 23 | 23 | { |
| 24 | 24 | return $this->attributes->mayHave('object_created')->asInstanceOf('\\DateTime'); |
| 25 | 25 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @return \DateTime |
| 31 | 31 | */ |
| 32 | - public function getObjectUpdated() |
|
| 32 | + public function getObjectUpdated () |
|
| 33 | 33 | { |
| 34 | 34 | return $this->attributes->mayHave('object_updated')->asInstanceOf('\\DateTime'); |
| 35 | 35 | } |