@@ -119,8 +119,8 @@ |
||
119 | 119 | ); |
120 | 120 | } |
121 | 121 | |
122 | - if (isset($atHomeXml->requestedDeliveryDate) && (string)$atHomeXml->requestedDeliveryDate !== '') { |
|
123 | - $self->setRequestedDeliveryDate((string)$atHomeXml->requestedDeliveryDate); |
|
122 | + if (isset($atHomeXml->requestedDeliveryDate) && (string) $atHomeXml->requestedDeliveryDate !== '') { |
|
123 | + $self->setRequestedDeliveryDate((string) $atHomeXml->requestedDeliveryDate); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | return $self; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | public function setValue(int $value): void |
97 | 97 | { |
98 | 98 | if (!in_array($value, self::getPossibleValueValues(), true)) { |
99 | - throw new BpostInvalidValueException('value', (string)$value, self::getPossibleValueValues()); |
|
99 | + throw new BpostInvalidValueException('value', (string) $value, self::getPossibleValueValues()); |
|
100 | 100 | } |
101 | 101 | $this->value = $value; |
102 | 102 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $insured->appendChild($insurance); |
119 | 119 | |
120 | 120 | if ($this->getValue() !== null) { |
121 | - $insurance->setAttribute('value', (string)$this->getValue()); |
|
121 | + $insurance->setAttribute('value', (string) $this->getValue()); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | return $insured; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $insuranceDetail = $xml->children('http://schema.post.be/shm/deepintegration/v3/common'); |
133 | 133 | $type = $insuranceDetail->getName(); |
134 | 134 | $valueAttr = $insuranceDetail->attributes()->value ?? null; |
135 | - $value = $valueAttr !== null ? (int)$valueAttr : null; |
|
135 | + $value = $valueAttr !== null ? (int) $valueAttr : null; |
|
136 | 136 | |
137 | 137 | // Compat héritée : additionalInsurance avec value=1 => basicInsurance sans value |
138 | 138 | if ($type === static::INSURANCE_TYPE_ADDITIONAL_INSURANCE && $value === 1) { |
@@ -169,13 +169,13 @@ |
||
169 | 169 | */ |
170 | 170 | public static function createFromXML(SimpleXMLElement $xml): static |
171 | 171 | { |
172 | - $messaging = new static($xml->getName(), (string)$xml->attributes()->language); |
|
172 | + $messaging = new static($xml->getName(), (string) $xml->attributes()->language); |
|
173 | 173 | |
174 | - if ((string)$xml->emailAddress !== '') { |
|
175 | - $messaging->setEmailAddress((string)$xml->emailAddress); |
|
174 | + if ((string) $xml->emailAddress !== '') { |
|
175 | + $messaging->setEmailAddress((string) $xml->emailAddress); |
|
176 | 176 | } |
177 | - if ((string)$xml->mobilePhone !== '') { |
|
178 | - $messaging->setMobilePhone((string)$xml->mobilePhone); |
|
177 | + if ((string) $xml->mobilePhone !== '') { |
|
178 | + $messaging->setMobilePhone((string) $xml->mobilePhone); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | return $messaging; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $international->appendChild( |
175 | 175 | $document->createElement( |
176 | 176 | XmlHelper::getPrefixedTagName('parcelWeight', $innerPrefix), |
177 | - (string)$this->parcelWeight |
|
177 | + (string) $this->parcelWeight |
|
178 | 178 | ) |
179 | 179 | ); |
180 | 180 | } |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | { |
204 | 204 | $international = new self(); |
205 | 205 | |
206 | - if (isset($xml->international->product) && (string)$xml->international->product !== '') { |
|
207 | - $international->setProduct((string)$xml->international->product); |
|
206 | + if (isset($xml->international->product) && (string) $xml->international->product !== '') { |
|
207 | + $international->setProduct((string) $xml->international->product); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | if (isset($xml->international->options)) { |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $option = Messaging::createFromXML($optionData); |
219 | 219 | break; |
220 | 220 | default: |
221 | - $className = '\\Bpost\\BpostApiClient\\Bpost\\Order\\Box\\Option\\' . ucfirst($optionData->getName()); |
|
221 | + $className = '\\Bpost\\BpostApiClient\\Bpost\\Order\\Box\\Option\\'.ucfirst($optionData->getName()); |
|
222 | 222 | XmlHelper::assertMethodCreateFromXmlExists($className); |
223 | 223 | $option = $className::createFromXML($optionData); |
224 | 224 | } |
@@ -226,8 +226,8 @@ discard block |
||
226 | 226 | } |
227 | 227 | } |
228 | 228 | |
229 | - if (isset($xml->international->parcelWeight) && (string)$xml->international->parcelWeight !== '') { |
|
230 | - $international->setParcelWeight((int)$xml->international->parcelWeight); |
|
229 | + if (isset($xml->international->parcelWeight) && (string) $xml->international->parcelWeight !== '') { |
|
230 | + $international->setParcelWeight((int) $xml->international->parcelWeight); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | if (isset($xml->international->receiver)) { |
@@ -106,16 +106,16 @@ |
||
106 | 106 | { |
107 | 107 | $self = new self(); |
108 | 108 | |
109 | - if (isset($xml->language) && (string)$xml->language !== '') { |
|
110 | - $self->setLanguage((string)$xml->language); |
|
109 | + if (isset($xml->language) && (string) $xml->language !== '') { |
|
110 | + $self->setLanguage((string) $xml->language); |
|
111 | 111 | } |
112 | 112 | |
113 | - if (isset($xml->mobilePhone) && (string)$xml->mobilePhone !== '') { |
|
114 | - $self->setMobilePhone((string)$xml->mobilePhone); |
|
113 | + if (isset($xml->mobilePhone) && (string) $xml->mobilePhone !== '') { |
|
114 | + $self->setMobilePhone((string) $xml->mobilePhone); |
|
115 | 115 | } |
116 | 116 | |
117 | - if (isset($xml->emailAddress) && (string)$xml->emailAddress !== '') { |
|
118 | - $self->setEmailAddress((string)$xml->emailAddress); |
|
117 | + if (isset($xml->emailAddress) && (string) $xml->emailAddress !== '') { |
|
118 | + $self->setEmailAddress((string) $xml->emailAddress); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | if (isset($xml->parcelLockerReducedMobilityZone)) { |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | { |
187 | 187 | $atBpost = new AtBpost(); |
188 | 188 | |
189 | - if (isset($xml->atBpost->product) && (string)$xml->atBpost->product !== '') { |
|
190 | - $atBpost->setProduct((string)$xml->atBpost->product); |
|
189 | + if (isset($xml->atBpost->product) && (string) $xml->atBpost->product !== '') { |
|
190 | + $atBpost->setProduct((string) $xml->atBpost->product); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | if (isset($xml->atBpost->options)) { |
@@ -213,31 +213,31 @@ discard block |
||
213 | 213 | } |
214 | 214 | } |
215 | 215 | |
216 | - if (isset($xml->atBpost->weight) && (string)$xml->atBpost->weight !== '') { |
|
217 | - $atBpost->setWeight((int)$xml->atBpost->weight); |
|
216 | + if (isset($xml->atBpost->weight) && (string) $xml->atBpost->weight !== '') { |
|
217 | + $atBpost->setWeight((int) $xml->atBpost->weight); |
|
218 | 218 | } |
219 | - if (isset($xml->atBpost->receiverName) && (string)$xml->atBpost->receiverName !== '') { |
|
220 | - $atBpost->setReceiverName((string)$xml->atBpost->receiverName); |
|
219 | + if (isset($xml->atBpost->receiverName) && (string) $xml->atBpost->receiverName !== '') { |
|
220 | + $atBpost->setReceiverName((string) $xml->atBpost->receiverName); |
|
221 | 221 | } |
222 | - if (isset($xml->atBpost->receiverCompany) && (string)$xml->atBpost->receiverCompany !== '') { |
|
223 | - $atBpost->setReceiverCompany((string)$xml->atBpost->receiverCompany); |
|
222 | + if (isset($xml->atBpost->receiverCompany) && (string) $xml->atBpost->receiverCompany !== '') { |
|
223 | + $atBpost->setReceiverCompany((string) $xml->atBpost->receiverCompany); |
|
224 | 224 | } |
225 | - if (isset($xml->atBpost->pugoId) && (string)$xml->atBpost->pugoId !== '') { |
|
226 | - $atBpost->setPugoId((string)$xml->atBpost->pugoId); |
|
225 | + if (isset($xml->atBpost->pugoId) && (string) $xml->atBpost->pugoId !== '') { |
|
226 | + $atBpost->setPugoId((string) $xml->atBpost->pugoId); |
|
227 | 227 | } |
228 | - if (isset($xml->atBpost->pugoName) && (string)$xml->atBpost->pugoName !== '') { |
|
229 | - $atBpost->setPugoName((string)$xml->atBpost->pugoName); |
|
228 | + if (isset($xml->atBpost->pugoName) && (string) $xml->atBpost->pugoName !== '') { |
|
229 | + $atBpost->setPugoName((string) $xml->atBpost->pugoName); |
|
230 | 230 | } |
231 | 231 | if (isset($xml->atBpost->pugoAddress)) { |
232 | 232 | $pugoAddressData = $xml->atBpost->pugoAddress |
233 | 233 | ->children('http://schema.post.be/shm/deepintegration/v3/common'); |
234 | 234 | $atBpost->setPugoAddress(PugoAddress::createFromXML($pugoAddressData)); |
235 | 235 | } |
236 | - if (isset($xml->atBpost->requestedDeliveryDate) && (string)$xml->atBpost->requestedDeliveryDate !== '') { |
|
237 | - $atBpost->setRequestedDeliveryDate((string)$xml->atBpost->requestedDeliveryDate); |
|
236 | + if (isset($xml->atBpost->requestedDeliveryDate) && (string) $xml->atBpost->requestedDeliveryDate !== '') { |
|
237 | + $atBpost->setRequestedDeliveryDate((string) $xml->atBpost->requestedDeliveryDate); |
|
238 | 238 | } |
239 | - if (isset($xml->atBpost->shopHandlingInstruction) && (string)$xml->atBpost->shopHandlingInstruction !== '') { |
|
240 | - $atBpost->setShopHandlingInstruction((string)$xml->atBpost->shopHandlingInstruction); |
|
239 | + if (isset($xml->atBpost->shopHandlingInstruction) && (string) $xml->atBpost->shopHandlingInstruction !== '') { |
|
240 | + $atBpost->setShopHandlingInstruction((string) $xml->atBpost->shopHandlingInstruction); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | return $atBpost; |
@@ -244,26 +244,26 @@ discard block |
||
244 | 244 | { |
245 | 245 | $customsInfo = new self(); |
246 | 246 | |
247 | - if (isset($xml->parcelValue) && (string)$xml->parcelValue !== '') { |
|
248 | - $customsInfo->setParcelValue((int)$xml->parcelValue); |
|
247 | + if (isset($xml->parcelValue) && (string) $xml->parcelValue !== '') { |
|
248 | + $customsInfo->setParcelValue((int) $xml->parcelValue); |
|
249 | 249 | } |
250 | - if (isset($xml->contentDescription) && (string)$xml->contentDescription !== '') { |
|
251 | - $customsInfo->setContentDescription((string)$xml->contentDescription); |
|
250 | + if (isset($xml->contentDescription) && (string) $xml->contentDescription !== '') { |
|
251 | + $customsInfo->setContentDescription((string) $xml->contentDescription); |
|
252 | 252 | } |
253 | - if (isset($xml->shipmentType) && (string)$xml->shipmentType !== '') { |
|
254 | - $customsInfo->setShipmentType((string)$xml->shipmentType); |
|
253 | + if (isset($xml->shipmentType) && (string) $xml->shipmentType !== '') { |
|
254 | + $customsInfo->setShipmentType((string) $xml->shipmentType); |
|
255 | 255 | } |
256 | - if (isset($xml->parcelReturnInstructions) && (string)$xml->parcelReturnInstructions !== '') { |
|
257 | - $customsInfo->setParcelReturnInstructions((string)$xml->parcelReturnInstructions); |
|
256 | + if (isset($xml->parcelReturnInstructions) && (string) $xml->parcelReturnInstructions !== '') { |
|
257 | + $customsInfo->setParcelReturnInstructions((string) $xml->parcelReturnInstructions); |
|
258 | 258 | } |
259 | - if (isset($xml->privateAddress) && (string)$xml->privateAddress !== '') { |
|
260 | - $customsInfo->setPrivateAddress(in_array((string)$xml->privateAddress, ['true', '1'], true)); |
|
259 | + if (isset($xml->privateAddress) && (string) $xml->privateAddress !== '') { |
|
260 | + $customsInfo->setPrivateAddress(in_array((string) $xml->privateAddress, ['true', '1'], true)); |
|
261 | 261 | } |
262 | - if (isset($xml->currency) && (string)$xml->currency !== '') { |
|
263 | - $customsInfo->setCurrency((string)$xml->currency); |
|
262 | + if (isset($xml->currency) && (string) $xml->currency !== '') { |
|
263 | + $customsInfo->setCurrency((string) $xml->currency); |
|
264 | 264 | } |
265 | - if (isset($xml->amtPostagePaidByAddresse) && (string)$xml->amtPostagePaidByAddresse !== '') { |
|
266 | - $customsInfo->setAmtPostagePaidByAddresse((float)$xml->amtPostagePaidByAddresse); |
|
265 | + if (isset($xml->amtPostagePaidByAddresse) && (string) $xml->amtPostagePaidByAddresse !== '') { |
|
266 | + $customsInfo->setAmtPostagePaidByAddresse((float) $xml->amtPostagePaidByAddresse); |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | return $customsInfo; |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $customsInfo->appendChild( |
277 | 277 | $document->createElement( |
278 | 278 | XmlHelper::getPrefixedTagName('parcelValue', $prefix), |
279 | - (string)$this->getParcelValue() |
|
279 | + (string) $this->getParcelValue() |
|
280 | 280 | ) |
281 | 281 | ); |
282 | 282 | } |
@@ -90,8 +90,8 @@ |
||
90 | 90 | ); |
91 | 91 | } |
92 | 92 | |
93 | - if (isset($bpostOnAppointmentXml->inNetworkCutOff) && (string)$bpostOnAppointmentXml->inNetworkCutOff !== '') { |
|
94 | - $self->setInNetworkCutOff((string)$bpostOnAppointmentXml->inNetworkCutOff); |
|
93 | + if (isset($bpostOnAppointmentXml->inNetworkCutOff) && (string) $bpostOnAppointmentXml->inNetworkCutOff !== '') { |
|
94 | + $self->setInNetworkCutOff((string) $bpostOnAppointmentXml->inNetworkCutOff); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | return $self; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | if ($this->memberId !== null) { |
160 | 160 | $boxElement->appendChild($document->createElement('memberId', $this->memberId)); |
161 | - }else if ($this->unregistered !== null) { |
|
161 | + } else if ($this->unregistered !== null) { |
|
162 | 162 | $boxElement->appendChild($this->unregistered->toXML($document)); |
163 | 163 | } |
164 | 164 | |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | { |
194 | 194 | $at247 = new At247(); |
195 | 195 | |
196 | - if (isset($xml->{'at24-7'}->product) && (string)$xml->{'at24-7'}->product !== '') { |
|
197 | - $at247->setProduct((string)$xml->{'at24-7'}->product); |
|
196 | + if (isset($xml->{'at24-7'}->product) && (string) $xml->{'at24-7'}->product !== '') { |
|
197 | + $at247->setProduct((string) $xml->{'at24-7'}->product); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | if (isset($xml->{'at24-7'}->options)) { |
@@ -211,31 +211,31 @@ discard block |
||
211 | 211 | } |
212 | 212 | } |
213 | 213 | |
214 | - if (isset($xml->{'at24-7'}->weight) && (string)$xml->{'at24-7'}->weight !== '') { |
|
215 | - $at247->setWeight((int)$xml->{'at24-7'}->weight); |
|
214 | + if (isset($xml->{'at24-7'}->weight) && (string) $xml->{'at24-7'}->weight !== '') { |
|
215 | + $at247->setWeight((int) $xml->{'at24-7'}->weight); |
|
216 | 216 | } |
217 | - if (isset($xml->{'at24-7'}->memberId) && (string)$xml->{'at24-7'}->memberId !== '') { |
|
218 | - $at247->setMemberId((string)$xml->{'at24-7'}->memberId); |
|
217 | + if (isset($xml->{'at24-7'}->memberId) && (string) $xml->{'at24-7'}->memberId !== '') { |
|
218 | + $at247->setMemberId((string) $xml->{'at24-7'}->memberId); |
|
219 | 219 | } |
220 | - if (isset($xml->{'at24-7'}->receiverName) && (string)$xml->{'at24-7'}->receiverName !== '') { |
|
221 | - $at247->setReceiverName((string)$xml->{'at24-7'}->receiverName); |
|
220 | + if (isset($xml->{'at24-7'}->receiverName) && (string) $xml->{'at24-7'}->receiverName !== '') { |
|
221 | + $at247->setReceiverName((string) $xml->{'at24-7'}->receiverName); |
|
222 | 222 | } |
223 | - if (isset($xml->{'at24-7'}->receiverCompany) && (string)$xml->{'at24-7'}->receiverCompany !== '') { |
|
224 | - $at247->setReceiverCompany((string)$xml->{'at24-7'}->receiverCompany); |
|
223 | + if (isset($xml->{'at24-7'}->receiverCompany) && (string) $xml->{'at24-7'}->receiverCompany !== '') { |
|
224 | + $at247->setReceiverCompany((string) $xml->{'at24-7'}->receiverCompany); |
|
225 | 225 | } |
226 | - if (isset($xml->{'at24-7'}->parcelsDepotId) && (string)$xml->{'at24-7'}->parcelsDepotId !== '') { |
|
227 | - $at247->setParcelsDepotId((string)$xml->{'at24-7'}->parcelsDepotId); |
|
226 | + if (isset($xml->{'at24-7'}->parcelsDepotId) && (string) $xml->{'at24-7'}->parcelsDepotId !== '') { |
|
227 | + $at247->setParcelsDepotId((string) $xml->{'at24-7'}->parcelsDepotId); |
|
228 | 228 | } |
229 | - if (isset($xml->{'at24-7'}->parcelsDepotName) && (string)$xml->{'at24-7'}->parcelsDepotName !== '') { |
|
230 | - $at247->setParcelsDepotName((string)$xml->{'at24-7'}->parcelsDepotName); |
|
229 | + if (isset($xml->{'at24-7'}->parcelsDepotName) && (string) $xml->{'at24-7'}->parcelsDepotName !== '') { |
|
230 | + $at247->setParcelsDepotName((string) $xml->{'at24-7'}->parcelsDepotName); |
|
231 | 231 | } |
232 | 232 | if (isset($xml->{'at24-7'}->parcelsDepotAddress)) { |
233 | 233 | $parcelsDepotAddressData = $xml->{'at24-7'}->parcelsDepotAddress |
234 | 234 | ->children('http://schema.post.be/shm/deepintegration/v3/common'); |
235 | 235 | $at247->setParcelsDepotAddress(ParcelsDepotAddress::createFromXML($parcelsDepotAddressData)); |
236 | 236 | } |
237 | - if (isset($xml->{'at24-7'}->requestedDeliveryDate) && (string)$xml->{'at24-7'}->requestedDeliveryDate !== '') { |
|
238 | - $at247->setRequestedDeliveryDate((string)$xml->{'at24-7'}->requestedDeliveryDate); |
|
237 | + if (isset($xml->{'at24-7'}->requestedDeliveryDate) && (string) $xml->{'at24-7'}->requestedDeliveryDate !== '') { |
|
238 | + $at247->setRequestedDeliveryDate((string) $xml->{'at24-7'}->requestedDeliveryDate); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | return $at247; |