1 | <?php |
||
27 | class CustomerCareOrderItemTotals implements ICustomerCareOrderItemTotals |
||
28 | { |
||
29 | use TPayload; |
||
30 | |||
31 | /** @var float */ |
||
32 | protected $charges; |
||
33 | /** @var float */ |
||
34 | protected $discount; |
||
35 | /** @var float */ |
||
36 | protected $extendedPrice; |
||
37 | /** @var float */ |
||
38 | protected $lineTotal; |
||
39 | /** @var float */ |
||
40 | protected $lineTotalWithoutTax; |
||
41 | /** @var float */ |
||
42 | protected $pricingQty; |
||
43 | /** @var float */ |
||
44 | protected $shippingCharges; |
||
45 | /** @var float */ |
||
46 | protected $shippingDiscount; |
||
47 | /** @var float */ |
||
48 | protected $shippingTotal; |
||
49 | /** @var float */ |
||
50 | protected $tax; |
||
51 | /** @var float */ |
||
52 | protected $unitPrice; |
||
53 | /** @var string */ |
||
54 | protected $minLineStatus; |
||
55 | /** @var string */ |
||
56 | protected $minLineStatusDescription; |
||
57 | /** @var string */ |
||
58 | protected $maxLineStatus; |
||
59 | /** @var string */ |
||
60 | protected $maxLineStatusDescription; |
||
61 | |||
62 | /** |
||
63 | * @param IValidatorIterator |
||
64 | * @param ISchemaValidator |
||
65 | * @param IPayloadMap |
||
66 | * @param LoggerInterface |
||
67 | * @param IPayload |
||
68 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
||
69 | */ |
||
70 | public function __construct( |
||
71 | IValidatorIterator $validators, |
||
72 | ISchemaValidator $schemaValidator, |
||
73 | IPayloadMap $payloadMap, |
||
74 | LoggerInterface $logger, |
||
75 | IPayload $parentPayload = null |
||
76 | ) { |
||
77 | $this->logger = $logger; |
||
|
|||
78 | $this->validators = $validators; |
||
79 | $this->schemaValidator = $schemaValidator; |
||
80 | $this->parentPayload = $parentPayload; |
||
81 | $this->payloadMap = $payloadMap; |
||
82 | $this->payloadFactory = $this->getNewPayloadFactory(); |
||
83 | $this->isSerializeEmptyNode = false; |
||
84 | $this->initOptionalExtractPaths(); |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * Initialize the protected class property array self::optionalExtractionPaths with xpath |
||
89 | * key/value pairs. |
||
90 | * |
||
91 | * @return self |
||
92 | */ |
||
93 | protected function initOptionalExtractPaths() |
||
94 | { |
||
95 | $this->optionalExtractionPaths = [ |
||
96 | 'charges' => 'x:Charges', |
||
97 | 'discount' => 'x:Discount', |
||
98 | 'extendedPrice' => 'x:ExtendedPrice', |
||
99 | 'lineTotal' => 'x:LineTotal', |
||
100 | 'lineTotalWithoutTax' => 'x:LineTotalWithoutTax', |
||
101 | 'pricingQty' => 'x:PricingQty', |
||
102 | 'shippingCharges' => 'x:ShippingCharges', |
||
103 | 'shippingDiscount' => 'x:ShippingDiscount', |
||
104 | 'shippingTotal' => 'x:ShippingTotal', |
||
105 | 'tax' => 'x:Tax', |
||
106 | 'unitPrice' => 'x:UnitPrice', |
||
107 | 'minLineStatus' => 'x:MinLineStatus', |
||
108 | 'minLineStatusDescription' => 'x:MinLineStatus/@description', |
||
109 | 'maxLineStatus' => 'x:MaxLineStatus', |
||
110 | 'maxLineStatusDescription' => 'x:MaxLineStatus/@description', |
||
111 | ]; |
||
112 | return $this; |
||
113 | } |
||
114 | |||
115 | /** |
||
116 | * @see ICustomerCareOrderItemTotals::getCharges() |
||
117 | */ |
||
118 | public function getCharges() |
||
122 | |||
123 | /** |
||
124 | * @see ICustomerCareOrderItemTotals::setCharges() |
||
125 | * @codeCoverageIgnore |
||
126 | */ |
||
127 | public function setCharges($charges) |
||
128 | { |
||
129 | $this->charges = $charges; |
||
130 | return $this; |
||
131 | } |
||
132 | |||
133 | /** |
||
134 | * @see ICustomerCareOrderItemTotals::getDiscount() |
||
135 | */ |
||
136 | public function getDiscount() |
||
140 | |||
141 | /** |
||
142 | * @see ICustomerCareOrderItemTotals::setDiscount() |
||
143 | * @codeCoverageIgnore |
||
144 | */ |
||
145 | public function setDiscount($discount) |
||
146 | { |
||
147 | $this->discount = $discount; |
||
148 | return $this; |
||
149 | } |
||
150 | |||
151 | /** |
||
152 | * @see ICustomerCareOrderItemTotals::getExtendedPrice() |
||
153 | */ |
||
154 | public function getExtendedPrice() |
||
158 | |||
159 | /** |
||
160 | * @see ICustomerCareOrderItemTotals::setExtendedPrice() |
||
161 | * @codeCoverageIgnore |
||
162 | */ |
||
163 | public function setExtendedPrice($extendedPrice) |
||
164 | { |
||
165 | $this->extendedPrice = $extendedPrice; |
||
166 | return $this; |
||
167 | } |
||
168 | |||
169 | /** |
||
170 | * @see ICustomerCareOrderItemTotals::getLineTotal() |
||
171 | */ |
||
172 | public function getLineTotal() |
||
176 | |||
177 | /** |
||
178 | * @see ICustomerCareOrderItemTotals::setLineTotal() |
||
179 | * @codeCoverageIgnore |
||
180 | */ |
||
181 | public function setLineTotal($lineTotal) |
||
182 | { |
||
183 | $this->lineTotal = $lineTotal; |
||
184 | return $this; |
||
185 | } |
||
186 | |||
187 | /** |
||
188 | * @see ICustomerCareOrderItemTotals::getLineTotalWithoutTax() |
||
189 | */ |
||
190 | public function getLineTotalWithoutTax() |
||
194 | |||
195 | /** |
||
196 | * @see ICustomerCareOrderItemTotals::setLineTotalWithoutTax() |
||
197 | * @codeCoverageIgnore |
||
198 | */ |
||
199 | public function setLineTotalWithoutTax($lineTotalWithoutTax) |
||
200 | { |
||
201 | $this->lineTotalWithoutTax = $lineTotalWithoutTax; |
||
202 | return $this; |
||
203 | } |
||
204 | |||
205 | /** |
||
206 | * @see ICustomerCareOrderItemTotals::getPricingQty() |
||
207 | */ |
||
208 | public function getPricingQty() |
||
212 | |||
213 | /** |
||
214 | * @see ICustomerCareOrderItemTotals::setPricingQty() |
||
215 | * @codeCoverageIgnore |
||
216 | */ |
||
217 | public function setPricingQty($pricingQty) |
||
218 | { |
||
219 | $this->pricingQty = $pricingQty; |
||
220 | return $this; |
||
221 | } |
||
222 | |||
223 | /** |
||
224 | * @see ICustomerCareOrderItemTotals::getShippingCharges() |
||
225 | */ |
||
226 | public function getShippingCharges() |
||
230 | |||
231 | /** |
||
232 | * @see ICustomerCareOrderItemTotals::setShippingCharges() |
||
233 | * @codeCoverageIgnore |
||
234 | */ |
||
235 | public function setShippingCharges($shippingCharges) |
||
236 | { |
||
237 | $this->shippingCharges = $shippingCharges; |
||
238 | return $this; |
||
239 | } |
||
240 | |||
241 | /** |
||
242 | * @see ICustomerCareOrderItemTotals::getShippingDiscount() |
||
243 | */ |
||
244 | public function getShippingDiscount() |
||
248 | |||
249 | /** |
||
250 | * @see ICustomerCareOrderItemTotals::setShippingDiscount() |
||
251 | * @codeCoverageIgnore |
||
252 | */ |
||
253 | public function setShippingDiscount($shippingDiscount) |
||
254 | { |
||
255 | $this->shippingDiscount = $shippingDiscount; |
||
256 | return $this; |
||
257 | } |
||
258 | |||
259 | /** |
||
260 | * @see ICustomerCareOrderItemTotals::getShippingTotal() |
||
261 | */ |
||
262 | public function getShippingTotal() |
||
266 | |||
267 | /** |
||
268 | * @see ICustomerCareOrderItemTotals::setShippingTotal() |
||
269 | * @codeCoverageIgnore |
||
270 | */ |
||
271 | public function setShippingTotal($shippingTotal) |
||
272 | { |
||
273 | $this->shippingTotal = $shippingTotal; |
||
274 | return $this; |
||
275 | } |
||
276 | |||
277 | /** |
||
278 | * @see ICustomerCareOrderItemTotals::getTax() |
||
279 | */ |
||
280 | public function getTax() |
||
284 | |||
285 | /** |
||
286 | * @see ICustomerCareOrderItemTotals::setTax() |
||
287 | * @codeCoverageIgnore |
||
288 | */ |
||
289 | public function setTax($tax) |
||
290 | { |
||
291 | $this->tax = $tax; |
||
292 | return $this; |
||
293 | } |
||
294 | |||
295 | /** |
||
296 | * @see ICustomerCareOrderItemTotals::getUnitPrice() |
||
297 | */ |
||
298 | public function getUnitPrice() |
||
302 | |||
303 | /** |
||
304 | * @see ICustomerCareOrderItemTotals::setUnitPrice() |
||
305 | * @codeCoverageIgnore |
||
306 | */ |
||
307 | public function setUnitPrice($unitPrice) |
||
308 | { |
||
309 | $this->unitPrice = $unitPrice; |
||
310 | return $this; |
||
311 | } |
||
312 | |||
313 | /** |
||
314 | * @see ICustomerCareOrderItemTotals::getMinLineStatus() |
||
315 | */ |
||
316 | public function getMinLineStatus() |
||
320 | |||
321 | /** |
||
322 | * @see ICustomerCareOrderItemTotals::setMinLineStatus() |
||
323 | * @codeCoverageIgnore |
||
324 | */ |
||
325 | public function setMinLineStatus($minLineStatus) |
||
326 | { |
||
327 | $this->minLineStatus = $minLineStatus; |
||
328 | return $this; |
||
329 | } |
||
330 | |||
331 | /** |
||
332 | * @see ICustomerCareOrderItemTotals::getMinLineStatusDescription() |
||
333 | */ |
||
334 | public function getMinLineStatusDescription() |
||
338 | |||
339 | /** |
||
340 | * @see ICustomerCareOrderItemTotals::setMinLineStatusDescription() |
||
341 | * @codeCoverageIgnore |
||
342 | */ |
||
343 | public function setMinLineStatusDescription($minLineStatusDescription) |
||
344 | { |
||
345 | $this->minLineStatusDescription = $minLineStatusDescription; |
||
346 | return $this; |
||
347 | } |
||
348 | |||
349 | /** |
||
350 | * @see ICustomerCareOrderItemTotals::getMaxLineStatus() |
||
351 | */ |
||
352 | public function getMaxLineStatus() |
||
356 | |||
357 | /** |
||
358 | * @see ICustomerCareOrderItemTotals::setMaxLineStatus() |
||
359 | * @codeCoverageIgnore |
||
360 | */ |
||
361 | public function setMaxLineStatus($maxLineStatus) |
||
362 | { |
||
363 | $this->maxLineStatus = $maxLineStatus; |
||
364 | return $this; |
||
365 | } |
||
366 | |||
367 | /** |
||
368 | * @see ICustomerCareOrderItemTotals::getMaxLineStatusDescription() |
||
369 | */ |
||
370 | public function getMaxLineStatusDescription() |
||
374 | |||
375 | /** |
||
376 | * @see ICustomerCareOrderItemTotals::setMaxLineStatusDescription() |
||
377 | * @codeCoverageIgnore |
||
378 | */ |
||
379 | public function setMaxLineStatusDescription($maxLineStatusDescription) |
||
380 | { |
||
381 | $this->maxLineStatusDescription = $maxLineStatusDescription; |
||
382 | return $this; |
||
383 | } |
||
384 | |||
385 | /** |
||
386 | * @see TPayload::serializeContents() |
||
387 | */ |
||
388 | protected function serializeContents() |
||
389 | { |
||
390 | return $this->serializeOptionalNumericValue('Charges', $this->getCharges()) |
||
391 | . $this->serializeOptionalNumericValue('Discount', $this->getDiscount()) |
||
392 | . $this->serializeOptionalNumericValue('ExtendedPrice', $this->getExtendedPrice()) |
||
393 | . $this->serializeOptionalNumericValue('LineTotal', $this->getLineTotal()) |
||
394 | . $this->serializeOptionalNumericValue('LineTotalWithoutTax', $this->getLineTotalWithoutTax()) |
||
395 | . $this->serializeOptionalNumericValue('PricingQty', $this->getLineTotalWithoutTax()) |
||
396 | . $this->serializeOptionalNumericValue('ShippingCharges', $this->getShippingCharges()) |
||
397 | . $this->serializeOptionalNumericValue('ShippingDiscount', $this->getShippingDiscount()) |
||
398 | . $this->serializeOptionalNumericValue('ShippingTotal', $this->getShippingTotal()) |
||
399 | . $this->serializeOptionalNumericValue('Tax', $this->getTax()) |
||
400 | . $this->serializeOptionalNumericValue('UnitPrice', $this->getUnitPrice()) |
||
401 | . $this->serializeLineStatusValue('MinLineStatus', $this->getMinLineStatus(), $this->getMinLineStatusDescription()) |
||
402 | . $this->serializeLineStatusValue('MaxLineStatus', $this->getMaxLineStatus(), $this->getMaxLineStatusDescription()); |
||
403 | } |
||
404 | |||
405 | /** |
||
406 | * Serialize optional node of type Numeric values, which include |
||
407 | * string with digits, int, and float data types. |
||
408 | * |
||
409 | * @param string |
||
410 | * @param mixed |
||
411 | * @return string | null |
||
412 | */ |
||
413 | protected function serializeOptionalNumericValue($nodeName, $value) |
||
417 | |||
418 | /** |
||
419 | * Serialize Min/Max line status XML node. |
||
420 | * |
||
421 | * @param string |
||
422 | * @param string |
||
423 | * @param string |
||
424 | * @return string | null |
||
425 | */ |
||
426 | protected function serializeLineStatusValue($nodeName, $value, $description) |
||
427 | { |
||
428 | $descriptionAttribute = $this->serializeOptionalAttribute('description', $description); |
||
429 | return $value |
||
430 | ? sprintf('<%s %s>%s</%1$s>', $nodeName, $descriptionAttribute, $this->xmlEncode($value)) : null; |
||
431 | } |
||
432 | |||
433 | /** |
||
434 | * @see TPayload::getRootNodeName() |
||
435 | */ |
||
436 | protected function getRootNodeName() |
||
440 | |||
441 | /** |
||
442 | * @see TPayload::getXmlNamespace() |
||
443 | */ |
||
444 | protected function getXmlNamespace() |
||
448 | } |
||
449 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..