GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

OrderResponse::serializeOrderHistoryUrlValue()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 4
nc 2
nop 2
1
<?php
2
/**
3
 * Copyright (c) 2013-2014 eBay Enterprise, Inc.
4
 *
5
 * NOTICE OF LICENSE
6
 *
7
 * This source file is subject to the Open Software License (OSL 3.0)
8
 * that is bundled with this package in the file LICENSE.md.
9
 * It is also available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * @copyright   Copyright (c) 2013-2015 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
13
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
14
 */
15
16
namespace eBayEnterprise\RetailOrderManagement\Payload\Order\Detail;
17
18
use eBayEnterprise\RetailOrderManagement\Payload\IPayload;
19
use eBayEnterprise\RetailOrderManagement\Payload\IPayloadMap;
20
use eBayEnterprise\RetailOrderManagement\Payload\ISchemaValidator;
21
use eBayEnterprise\RetailOrderManagement\Payload\IValidatorIterator;
22
use eBayEnterprise\RetailOrderManagement\Payload\TPayload;
23
use eBayEnterprise\RetailOrderManagement\Payload\PayloadFactory;
24
use eBayEnterprise\RetailOrderManagement\Payload\Order\TOrderItemContainer;
25
use eBayEnterprise\RetailOrderManagement\Payload\Order\TFeeContainer;
26
use eBayEnterprise\RetailOrderManagement\Payload\Order\TItemRelationshipContainer;
27
use eBayEnterprise\RetailOrderManagement\Payload\Order\TCustomAttributeContainer;
28
use eBayEnterprise\RetailOrderManagement\Payload\Order\TTemplateContainer;
29
use Psr\Log\LoggerInterface;
30
use Psr\Log\NullLogger;
31
use DateTime;
32
33
class OrderResponse implements IOrderResponse
34
{
35
    use TPayload, TOrderDetailItemContainer, TFeeContainer, TItemRelationshipContainer, TShipmentContainer, TCustomAttributeContainer, TTemplateContainer, TExchangeOrderContainer, TChargeGroupContainer;
36
37
    /** @var string */
38
    protected $customerOrderId;
39
    /** @var string */
40
    protected $levelOfService;
41
    /** @var bool */
42
    protected $hasChainedLines;
43
    /** @var bool */
44
    protected $hasDerivedChild;
45
    /** @var string */
46
    protected $sourceId;
47
    /** @var string */
48
    protected $sourceIdType;
49
    /** @var IOrderDetailCustomer */
50
    protected $customer;
51
    /** @var DateTime */
52
    protected $createTime;
53
    /** @var IOrderDetailShipping */
54
    protected $shipping;
55
    /** @var IOrderDetailPayment */
56
    protected $payment;
57
    /** @var string */
58
    protected $shopRunnerMessage;
59
    /** @var string */
60
    protected $currency;
61
    /** @var IAssociate */
62
    protected $associate;
63
    /** @var ITaxHeader */
64
    protected $taxHeader;
65
    /** @var string */
66
    protected $printedCatalogCode;
67
    /** @var string */
68
    protected $locale;
69
    /** @var string */
70
    protected $dashboardRepId;
71
    /** @var string */
72
    protected $orderSource;
73
    /** @var string */
74
    protected $orderSourceType;
75
    /** @var string */
76
    protected $status;
77
    /** @var string */
78
    protected $orderHistoryUrl;
79
    /** @var bool */
80
    protected $vatInclusivePricing;
81
82
    /**
83
     * @param IValidatorIterator
84
     * @param ISchemaValidator
85
     * @param IPayloadMap
86
     * @param LoggerInterface
87
     * @param IPayload
88
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
89
     */
90
    public function __construct(
91
        IValidatorIterator $validators,
92
        ISchemaValidator $schemaValidator,
93
        IPayloadMap $payloadMap,
94
        LoggerInterface $logger,
95
        IPayload $parentPayload = null
96
    ) {
97
        $this->logger = $logger;
0 ignored issues
show
Documentation Bug introduced by
It seems like $logger of type object<Psr\Log\LoggerInterface> is incompatible with the declared type object<eBayEnterprise\Re...ayload\LoggerInterface> of property $logger.

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..

Loading history...
98
        $this->validators = $validators;
99
        $this->schemaValidator = $schemaValidator;
100
        $this->parentPayload = $parentPayload;
101
        $this->payloadMap = $payloadMap;
102
        $this->payloadFactory = $this->getNewPayloadFactory();
103
104
        $this->initExtractPaths()
105
            ->initOptionalExtractPaths()
106
            ->initDatetimeExtractPaths()
107
            ->initSubPayloadExtractPaths()
108
            ->initSubPayloadProperties();
109
    }
110
111
    /**
112
     * Initialize the protected class property array self::extractionPaths with xpath
113
     * key/value pairs.
114
     *
115
     * @return self
116
     */
117
    protected function initExtractPaths()
118
    {
119
        $this->extractionPaths = [
120
            'currency' => 'string(x:Currency)',
121
        ];
122
        return $this;
123
    }
124
125
    /**
126
     * Initialize the protected class property array self::optionalExtractionPaths with xpath
127
     * key/value pairs.
128
     *
129
     * @return self
130
     */
131
    protected function initOptionalExtractPaths()
132
    {
133
        $this->optionalExtractionPaths = [
134
            'customerOrderId' => '@customerOrderId',
135
            'levelOfService' => '@levelOfService',
136
            'hasChainedLines' => '@hasChainedLines',
137
            'hasDerivedChild' => '@hasDerivedChild',
138
            'sourceId' => 'x:SourceId',
139
            'sourceIdType' => 'x:SourceId/@type',
140
            'shopRunnerMessage' => 'x:ShopRunnerMessage',
141
            'printedCatalogCode' => 'x:PrintedCatalogCode',
142
            'locale' => 'x:Locale',
143
            'dashboardRepId' => 'x:DashboardRepId',
144
            'orderSource' => 'x:OrderSource',
145
            'orderSourceType' => 'x:OrderSource/@type',
146
            'status' => 'x:Status',
147
            'orderHistoryUrl' => 'x:OrderHistoryUrl',
148
            'vatInclusivePricing' => 'x:VATInclusivePricing',
149
        ];
150
        return $this;
151
    }
152
153
    /**
154
     * Initialize the protected class property array self::subpayloadExtractionPaths with xpath
155
     * key/value pairs.
156
     *
157
     * @return self
158
     */
159
    protected function initSubPayloadExtractPaths()
160
    {
161
        $this->subpayloadExtractionPaths = [
162
            'customer' => 'x:Customer',
163
            'orderItems' => 'x:OrderItems',
164
            'shipping' => 'x:Shipping',
165
            'payment' => 'x:Payment',
166
            'fees' => 'x:Fees',
167
            'associate' => 'x:Associate',
168
            'taxHeader' => 'x:TaxHeader',
169
            'itemRelationships' => 'x:Relationships',
170
            'shipments' => 'x:Shipments',
171
            'customAttributes' => 'x:CustomAttributes',
172
            'templates' => 'x:Templates',
173
            'exchangeOrders' => 'x:ExchangeOrders',
174
            'chargeGroups' => 'x:ChargeGroups',
175
        ];
176
        return $this;
177
    }
178
179
    /**
180
     * Initialize the protected class property array self::datetimeExtractionPaths with xpath
181
     * key/value pairs.
182
     *
183
     * @return self
184
     */
185
    protected function initDatetimeExtractPaths()
186
    {
187
        $this->datetimeExtractionPaths = [
188
            'createTime' => 'string(x:CreateTime)',
189
        ];
190
        return $this;
191
    }
192
193
    /**
194
     * Initialize any sub-payload class properties with their concrete instance.
195
     *
196
     * @return self
197
     */
198
    protected function initSubPayloadProperties()
199
    {
200
        $this->setCustomer($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...ic::CUSTOMER_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...l\IOrderDetailCustomer>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
201
            static::CUSTOMER_INTERFACE
202
        ));
203
        $this->setOrderDetailItems($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...TEM_ITERABLE_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...rderDetailItemIterable>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
204
            static::ORDER_ITEM_ITERABLE_INTERFACE
205
        ));
206
        $this->setShipping($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...ic::SHIPPING_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...l\IOrderDetailShipping>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
207
            static::SHIPPING_INTERFACE
208
        ));
209
        $this->setPayment($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...tic::PAYMENT_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...il\IOrderDetailPayment>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
210
            static::PAYMENT_INTERFACE
211
        ));
212
        $this->setFees($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...FEE_ITERABLE_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...oad\Order\IFeeIterable>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
213
            static::FEE_ITERABLE_INTERFACE
214
        ));
215
        $this->setAssociate($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...c::ASSOCIATE_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...rder\Detail\IAssociate>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
216
            static::ASSOCIATE_INTERFACE
217
        ));
218
        $this->setTaxHeader($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...::TAX_HEADER_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...rder\Detail\ITaxHeader>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
219
            static::TAX_HEADER_INTERFACE
220
        ));
221
        $this->setItemRelationships($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...HIP_ITERABLE_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...emRelationshipIterable>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
222
            static::ITEM_RELATIONSHIP_ITERABLE_INTERFACE
223
        ));
224
        $this->setShipments($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...ENT_ITERABLE_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...tail\IShipmentIterable>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
225
            static::SHIPMENT_ITERABLE_INTERFACE
226
        ));
227
        $this->setCustomAttributes($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...UTE_ITERABLE_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...ustomAttributeIterable>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
228
            static::CUSTOM_ATTRIBUTE_ITERABLE_INTERFACE
229
        ));
230
        $this->setTemplates($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...ATE_ITERABLE_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...rder\ITemplateIterable>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
231
            static::TEMPLATE_ITERABLE_INTERFACE
232
        ));
233
        $this->setExchangeOrders($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...DER_ITERABLE_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...IExchangeOrderIterable>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
234
            static::EXCHANGE_ORDER_ITERABLE_INTERFACE
235
        ));
236
        $this->setChargeGroups($this->buildPayloadForInterface(
0 ignored issues
show
Compatibility introduced by
$this->buildPayloadForIn...OUP_ITERABLE_INTERFACE) of type object<eBayEnterprise\Re...ement\Payload\IPayload> is not a sub-type of object<eBayEnterprise\Re...l\IChargeGroupIterable>. It seems like you assume a child interface of the interface eBayEnterprise\RetailOrd...gement\Payload\IPayload to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
237
            self::CHARGE_GROUP_ITERABLE_INTERFACE
238
        ));
239
        return $this;
240
    }
241
242
    /**
243
     * @see IOrderResponse::getCustomerOrderId()
244
     */
245
    public function getCustomerOrderId()
246
    {
247
        return $this->customerOrderId;
248
    }
249
250
    /**
251
     * @see IOrderResponse::setCustomerOrderId()
252
     * @codeCoverageIgnore
253
     */
254
    public function setCustomerOrderId($customerOrderId)
255
    {
256
        $this->customerOrderId = $customerOrderId;
257
        return $this;
258
    }
259
260
    /**
261
     * @see IOrderResponse::getLevelOfService()
262
     */
263
    public function getLevelOfService()
264
    {
265
        return $this->levelOfService;
266
    }
267
268
    /**
269
     * @see IOrderResponse::setLevelOfService()
270
     * @codeCoverageIgnore
271
     */
272
    public function setLevelOfService($levelOfService)
273
    {
274
        $this->levelOfService = $levelOfService;
275
        return $this;
276
    }
277
278
    /**
279
     * @see IOrderResponse::getHasChainedLines()
280
     */
281
    public function getHasChainedLines()
282
    {
283
        return $this->hasChainedLines;
284
    }
285
286
    /**
287
     * @see IOrderResponse::setHasChainedLines()
288
     * @codeCoverageIgnore
289
     */
290
    public function setHasChainedLines($hasChainedLines)
291
    {
292
        $this->hasChainedLines = $hasChainedLines;
293
        return $this;
294
    }
295
296
    /**
297
     * @see IOrderResponse::getHasDerivedChild()
298
     */
299
    public function getHasDerivedChild()
300
    {
301
        return $this->hasDerivedChild;
302
    }
303
304
    /**
305
     * @see IOrderResponse::setHasDerivedChild()
306
     * @codeCoverageIgnore
307
     */
308
    public function setHasDerivedChild($hasDerivedChild)
309
    {
310
        $this->hasDerivedChild = $hasDerivedChild;
311
        return $this;
312
    }
313
314
    /**
315
     * @see IOrderResponse::getSourceId()
316
     */
317
    public function getSourceId()
318
    {
319
        return $this->sourceId;
320
    }
321
322
    /**
323
     * @see IOrderResponse::setSourceId()
324
     * @codeCoverageIgnore
325
     */
326
    public function setSourceId($sourceId)
327
    {
328
        $this->sourceId = $sourceId;
329
        return $this;
330
    }
331
332
    /**
333
     * @see IOrderResponse::getSourceIdType()
334
     */
335
    public function getSourceIdType()
336
    {
337
        return $this->sourceIdType;
338
    }
339
340
    /**
341
     * @see IOrderResponse::setSourceIdType()
342
     * @codeCoverageIgnore
343
     */
344
    public function setSourceIdType($sourceIdType)
345
    {
346
        $this->sourceIdType = $sourceIdType;
347
        return $this;
348
    }
349
350
    /**
351
     * @see IOrderResponse::getCustomer()
352
     */
353
    public function getCustomer()
354
    {
355
        return $this->customer;
356
    }
357
358
    /**
359
     * @see IOrderResponse::setCustomer()
360
     * @codeCoverageIgnore
361
     */
362
    public function setCustomer(IOrderDetailCustomer $customer)
363
    {
364
        $this->customer = $customer;
365
        return $this;
366
    }
367
368
    /**
369
     * @see IOrderResponse::getCreateTime()
370
     */
371
    public function getCreateTime()
372
    {
373
        return $this->createTime;
374
    }
375
376
    /**
377
     * @see IOrderResponse::setCreateTime()
378
     * @codeCoverageIgnore
379
     */
380
    public function setCreateTime(DateTime $createTime)
381
    {
382
        $this->createTime = $createTime;
383
        return $this;
384
    }
385
386
    /**
387
     * @see IOrderResponse::getShipping()
388
     */
389
    public function getShipping()
390
    {
391
        return $this->shipping;
392
    }
393
394
    /**
395
     * @see IOrderResponse::setShipping()
396
     * @codeCoverageIgnore
397
     */
398
    public function setShipping(IOrderDetailShipping $shipping)
399
    {
400
        $this->shipping = $shipping;
401
        return $this;
402
    }
403
404
    /**
405
     * @see IOrderResponse::getPayment()
406
     */
407
    public function getPayment()
408
    {
409
        return $this->payment;
410
    }
411
412
    /**
413
     * @see IOrderResponse::setPayment()
414
     * @codeCoverageIgnore
415
     */
416
    public function setPayment(IOrderDetailPayment $payment)
417
    {
418
        $this->payment = $payment;
419
        return $this;
420
    }
421
422
    /**
423
     * @see IOrderResponse::getShopRunnerMessage()
424
     */
425
    public function getShopRunnerMessage()
426
    {
427
        return $this->shopRunnerMessage;
428
    }
429
430
    /**
431
     * @see IOrderResponse::setShopRunnerMessage()
432
     * @codeCoverageIgnore
433
     */
434
    public function setShopRunnerMessage($shopRunnerMessage)
435
    {
436
        $this->shopRunnerMessage = $shopRunnerMessage;
437
        return $this;
438
    }
439
440
    /**
441
     * @see IOrderResponse::getCurrency()
442
     */
443
    public function getCurrency()
444
    {
445
        return $this->currency;
446
    }
447
448
    /**
449
     * @see IOrderResponse::setCurrency()
450
     * @codeCoverageIgnore
451
     */
452
    public function setCurrency($currency)
453
    {
454
        $this->currency = $currency;
455
        return $this;
456
    }
457
458
    /**
459
     * @see IOrderResponse::getAssociate()
460
     */
461
    public function getAssociate()
462
    {
463
        return $this->associate;
464
    }
465
466
    /**
467
     * @see IOrderResponse::setAssociate()
468
     * @codeCoverageIgnore
469
     */
470
    public function setAssociate(IAssociate $associate)
471
    {
472
        $this->associate = $associate;
473
        return $this;
474
    }
475
476
    /**
477
     * @see IOrderResponse::getTaxHeader()
478
     */
479
    public function getTaxHeader()
480
    {
481
        return $this->taxHeader;
482
    }
483
484
    /**
485
     * @see IOrderResponse::setTaxHeader()
486
     * @codeCoverageIgnore
487
     */
488
    public function setTaxHeader(ITaxHeader $taxHeader)
489
    {
490
        $this->taxHeader = $taxHeader;
491
        return $this;
492
    }
493
494
    /**
495
     * @see IOrderResponse::getPrintedCatalogCode()
496
     */
497
    public function getPrintedCatalogCode()
498
    {
499
        return $this->printedCatalogCode;
500
    }
501
502
    /**
503
     * @see IOrderResponse::setPrintedCatalogCode()
504
     * @codeCoverageIgnore
505
     */
506
    public function setPrintedCatalogCode($printedCatalogCode)
507
    {
508
        $this->printedCatalogCode = $printedCatalogCode;
509
        return $this;
510
    }
511
512
    /**
513
     * @see IOrderResponse::getLocale()
514
     */
515
    public function getLocale()
516
    {
517
        return $this->locale;
518
    }
519
520
    /**
521
     * @see IOrderResponse::setLocale()
522
     * @codeCoverageIgnore
523
     */
524
    public function setLocale($locale)
525
    {
526
        $this->locale = $locale;
527
        return $this;
528
    }
529
530
    /**
531
     * @see IOrderResponse::getDashboardRepId()
532
     */
533
    public function getDashboardRepId()
534
    {
535
        return $this->dashboardRepId;
536
    }
537
538
    /**
539
     * @see IOrderResponse::setDashboardRepId()
540
     * @codeCoverageIgnore
541
     */
542
    public function setDashboardRepId($dashboardRepId)
543
    {
544
        $this->dashboardRepId = $dashboardRepId;
545
        return $this;
546
    }
547
548
    /**
549
     * @see IOrderResponse::getOrderSource()
550
     */
551
    public function getOrderSource()
552
    {
553
        return $this->orderSource;
554
    }
555
556
    /**
557
     * @see IOrderResponse::setOrderSource()
558
     * @codeCoverageIgnore
559
     */
560
    public function setOrderSource($orderSource)
561
    {
562
        $this->orderSource = $orderSource;
563
        return $this;
564
    }
565
566
    /**
567
     * @see IOrderResponse::getOrderSourceType()
568
     */
569
    public function getOrderSourceType()
570
    {
571
        return $this->orderSourceType;
572
    }
573
574
    /**
575
     * @see IOrderResponse::setOrderSourceType()
576
     * @codeCoverageIgnore
577
     */
578
    public function setOrderSourceType($orderSourceType)
579
    {
580
        $this->orderSourceType = $orderSourceType;
581
        return $this;
582
    }
583
584
    /**
585
     * @see IOrderResponse::getStatus()
586
     */
587
    public function getStatus()
588
    {
589
        return $this->status;
590
    }
591
592
    /**
593
     * @see IOrderResponse::setStatus()
594
     * @codeCoverageIgnore
595
     */
596
    public function setStatus($status)
597
    {
598
        $this->status = $status;
599
        return $this;
600
    }
601
602
    /**
603
     * @see IOrderResponse::getOrderHistoryUrl()
604
     */
605
    public function getOrderHistoryUrl()
606
    {
607
        return $this->orderHistoryUrl;
608
    }
609
610
    /**
611
     * @see IOrderResponse::setOrderHistoryUrl()
612
     * @codeCoverageIgnore
613
     */
614
    public function setOrderHistoryUrl($orderHistoryUrl)
615
    {
616
        $this->orderHistoryUrl = $orderHistoryUrl;
617
        return $this;
618
    }
619
620
    /**
621
     * @see IOrderResponse::getVatInclusivePricing()
622
     */
623
    public function getVatInclusivePricing()
624
    {
625
        return $this->vatInclusivePricing;
626
    }
627
628
    /**
629
     * @see IOrderResponse::setVatInclusivePricing()
630
     * @codeCoverageIgnore
631
     */
632
    public function setVatInclusivePricing($vatInclusivePricing)
633
    {
634
        $this->vatInclusivePricing = $vatInclusivePricing;
635
        return $this;
636
    }
637
638
    /**
639
     * @see TPayload::serializeContents()
640
     */
641
    protected function serializeContents()
642
    {
643
        return $this->serializeSourceIdValue('SourceId', $this->getSourceId())
644
            . $this->getCustomer()->serialize()
645
            . $this->serializeOptionalDateValue('CreateTime', 'c', $this->getCreateTime())
646
            . $this->getOrderDetailItems()->serialize()
647
            . $this->getShipping()->serialize()
648
            . $this->getPayment()->serialize()
649
            . $this->getChargeGroups()->serialize()
650
            . $this->getFees()->serialize()
651
            . $this->serializeOptionalXmlEncodedValue('ShopRunnerMessage', $this->getShopRunnerMessage())
652
            . $this->serializeRequiredValue('Currency', $this->xmlEncode($this->getCurrency()))
653
            . $this->getAssociate()->serialize()
654
            . $this->getTaxHeader()->serialize()
655
            . $this->serializeOptionalXmlEncodedValue('PrintedCatalogCode', $this->getPrintedCatalogCode())
656
            . $this->serializeOptionalXmlEncodedValue('Locale', $this->getLocale())
657
            . $this->getItemRelationships()->serialize()
658
            . $this->getShipments()->serialize()
659
            . $this->serializeOptionalXmlEncodedValue('DashboardRepId', $this->getDashboardRepId())
660
            . $this->serializeOrderSourceValue('OrderSource', $this->getOrderSource())
661
            . $this->serializeOptionalXmlEncodedValue('Status', $this->getStatus())
662
            . $this->getCustomAttributes()->serialize()
663
            . $this->getTemplates()->serialize()
664
            . $this->serializeOrderHistoryUrlValue('OrderHistoryUrl', $this->getOrderHistoryUrl())
665
            . $this->serializeOptionalXmlEncodedValue('VATInclusivePricing', $this->getVatInclusivePricing())
666
            . $this->getExchangeOrders()->serialize();
667
    }
668
669
    /**
670
     * Serialize order history URL XML node.
671
     *
672
     * @param  string
673
     * @param  string
674
     * @return string | null
675
     */
676
    protected function serializeOrderHistoryUrlValue($nodeName, $value)
0 ignored issues
show
Unused Code introduced by
The parameter $nodeName is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $value is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
677
    {
678
        $orderHistoryUrl = $this->getOrderHistoryUrl();
679
        return $orderHistoryUrl
680
            ? $this->serializeOptionalXmlEncodedValue('OrderHistoryUrl', $orderHistoryUrl) : null;
681
    }
682
683
    /**
684
     * @see TPayload::getRootNodeName()
685
     */
686
    protected function getRootNodeName()
687
    {
688
        return static::ROOT_NODE;
689
    }
690
691
    /**
692
     * @see TPayload::getXmlNamespace()
693
     */
694
    protected function getXmlNamespace()
695
    {
696
        return self::XML_NS;
697
    }
698
699
    /**
700
     * @see TPayload::getRootAttributes()
701
     */
702 View Code Duplication
    protected function getRootAttributes()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
703
    {
704
        $customerOrderId = $this->getCustomerOrderId();
705
        $levelOfService = $this->getLevelOfService();
706
        $hasChainedLines = $this->getHasChainedLines();
707
        $hasDerivedChild = $this->getHasDerivedChild();
708
        return array_merge(
709
            $customerOrderId ? ['customerOrderId' => $customerOrderId] : [],
710
            $levelOfService ? ['levelOfService' => $levelOfService] : [],
711
            !empty($hasChainedLines) ? ['hasChainedLines' => $hasChainedLines] : [],
712
            !empty($hasDerivedChild) ? ['hasDerivedChild' => $hasDerivedChild] : []
713
        );
714
    }
715
716
    /**
717
     * Serialize the OrderSource XML node.
718
     *
719
     * @param  string
720
     * @param  string
721
     * @return string | null
722
     */
723
    protected function serializeOrderSourceValue($nodeName, $value)
724
    {
725
        $typeAttribute = $this->serializeOptionalAttribute('type', $this->xmlEncode($this->getOrderSourceType()));
726
        return $value
727
            ? sprintf('<%s %s>%s</%1$s>', $nodeName, $typeAttribute, $this->xmlEncode($value)) : null;
728
    }
729
730
    /**
731
     * Serialize the SourceId XML node.
732
     *
733
     * @param  string
734
     * @param  string
735
     * @return string | null
736
     */
737
    protected function serializeSourceIdValue($nodeName, $value)
738
    {
739
        $typeAttribute = $this->serializeOptionalAttribute('type', $this->xmlEncode($this->getSourceIdType()));
740
        return $value
741
            ? sprintf('<%s %s>%s</%1$s>', $nodeName, $typeAttribute, $this->xmlEncode($value)) : null;
742
    }
743
}
744