Passed
Pull Request — master (#316)
by
unknown
03:11
created

Shipment::getReturnService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Ups\Entity;
4
5
class Shipment
6
{
7
    
8
    const USPS_ENDORSEMENT_RETURN_SERVICE = 1;
9
    const USPS_ENDORSEMENT_FORWARDING_SERVICE = 2;
10
    const USPS_ENDORSEMENT_ADDRESS_SERVICE = 3;
11
    const USPS_ENDORSEMENT_CHANGE_SERVICE = 4;
12
    const USPS_ENDORSEMENT_NO_SERVICE = 5;
13
    /**
14
     * @var PaymentInformation
15
     */
16
    private $paymentInformation;
17
18
    /**
19
     * @var ItemizedPaymentInformation
20
     */
21
    private $itemizedPaymentInformation;
22
23
    /**
24
     * @var RateInformation
25
     */
26
    private $rateInformation;
27
28
    /**
29
     * @var string
30
     */
31
    private $description;
32
33
    /**
34
     * @var Shipper
35
     */
36
    private $shipper;
37
38
    /**
39
     * @var ShipTo;
40
     */
41
    private $shipTo;
42
43
    /**
44
     * @var SoldTo
45
     */
46
    private $soldTo;
47
48
    /**
49
     * @var ShipFrom
50
     */
51
    private $shipFrom;
52
53
    /**
54
     * @var AlternateDeliveryAddress
55
     */
56
    private $alternateDeliveryAddress;
57
58
    /**
59
     * @var ShipmentIndicationType
60
     */
61
    private $shipmentIndicationType;
62
63
    /**
64
     * @var Service
65
     */
66
    private $service;
67
68
    /**
69
     * @var ReturnService
70
     */
71
    private $returnService;
72
73
    /**
74
     * @var bool
75
     */
76
    private $documentsOnly;
77
78
    /**
79
     * @var Package[]
80
     */
81
    private $packages = [];
82
83
    /**
84
     * @var ReferenceNumber
85
     */
86
    private $referenceNumber;
87
88
    /**
89
     * @var ReferenceNumber
90
     */
91
    private $referenceNumber2;
92
93
    /**
94
     * @var ShipmentServiceOptions
95
     */
96
    private $shipmentServiceOptions;
97
98
    /**
99
     * @var bool
100
     */
101
    private $goodsNotInFreeCirculationIndicator;
102
103
    /**
104
     * @var string
105
     */
106
    private $movementReferenceNumber;
107
108
    /**
109
     * @var InvoiceLineTotal
110
     */
111
    private $invoiceLineTotal;
112
113
    /**
114
     * @var ShipmentTotalWeight
115
     */
116
    private $shipmentTotalWeight;
117
118
    /**
119
     * @var string
120
     */
121
    private $numOfPiecesInShipment;
122
123
    /**
124
     * @var DeliveryTimeInformation
125
     */
126
    private $deliveryTimeInformation;
127
    /**
128
     * @var bool
129
     */
130
    private $taxInformationIndicator;
131
    
132
    /**
133
     * Required for Mail Innovations.
134
     *
135
     * @var integer 
136
     */
137
    private $uspsEndorsement;
138
139
    /**
140
     * Required for Mail Innovations.
141
     *
142
     * @var string 
143
     */
144
    private $packageId;
145
146
    public function __construct()
147
    {
148
        $this->setShipper(new Shipper());
149
        $this->setShipTo(new ShipTo());
150
        $this->setShipmentServiceOptions(new ShipmentServiceOptions());
151
        $this->setService(new Service());
152
        $this->rateInformation = null;
153
        $this->taxInformationIndicator = false;
154
    }
155
156
    /**
157
     * @return ShipmentIndicationType
158
     */
159
    public function getShipmentIndicationType()
160
    {
161
        return $this->shipmentIndicationType;
162
    }
163
164
    /**
165
     * @param ShipmentIndicationType $shipmentIndicationType
166
     */
167
    public function setShipmentIndicationType(ShipmentIndicationType $shipmentIndicationType)
168
    {
169
        $this->shipmentIndicationType = $shipmentIndicationType;
170
    }
171
172
    /**
173
     * @return AlternateDeliveryAddress
174
     */
175
    public function getAlternateDeliveryAddress()
176
    {
177
        return $this->alternateDeliveryAddress;
178
    }
179
180
    /**
181
     * @param AlternateDeliveryAddress $alternateDeliveryAddress
182
     */
183
    public function setAlternateDeliveryAddress(AlternateDeliveryAddress $alternateDeliveryAddress)
184
    {
185
        $this->alternateDeliveryAddress = $alternateDeliveryAddress;
186
    }
187
188
    /**
189
     * @param Package $package
190
     *
191
     * @return Shipment
192
     */
193
    public function addPackage(Package $package)
194
    {
195
        $packages = $this->getPackages();
196
        $packages[] = $package;
197
        $this->setPackages($packages);
198
199
        return $this;
200
    }
201
202
    /**
203
     * @return string
204
     */
205
    public function getDescription()
206
    {
207
        return $this->description;
208
    }
209
210
    /**
211
     * @param string $description
212
     *
213
     * @return Shipment
214
     */
215
    public function setDescription($description)
216
    {
217
        $this->description = $description;
218
219
        return $this;
220
    }
221
222
    /**
223
     * @param ReferenceNumber $referenceNumber
224
     *
225
     * @return Shipment
226
     */
227
    public function setReferenceNumber(ReferenceNumber $referenceNumber)
228
    {
229
        $this->referenceNumber = $referenceNumber;
230
231
        return $this;
232
    }
233
234
    /**
235
     * @param ReferenceNumber $referenceNumber
236
     *
237
     * @return Shipment
238
     */
239
    public function setReferenceNumber2(ReferenceNumber $referenceNumber)
240
    {
241
        $this->referenceNumber2 = $referenceNumber;
242
243
        return $this;
244
    }
245
246
    /**
247
     * @return ReferenceNumber
248
     */
249
    public function getReferenceNumber()
250
    {
251
        return $this->referenceNumber;
252
    }
253
254
    /**
255
     * @return ReferenceNumber
256
     */
257
    public function getReferenceNumber2()
258
    {
259
        return $this->referenceNumber2;
260
    }
261
262
    /**
263
     * @return bool
264
     */
265
    public function getDocumentsOnly()
266
    {
267
        return $this->documentsOnly;
268
    }
269
270
    /**
271
     * @param bool $documentsOnly
272
     *
273
     * @return Shipment
274
     */
275
    public function setDocumentsOnly($documentsOnly)
276
    {
277
        $this->documentsOnly = $documentsOnly;
278
279
        return $this;
280
    }
281
282
    /**
283
     * @return Package[]
284
     */
285
    public function getPackages()
286
    {
287
        return $this->packages;
288
    }
289
290
    /**
291
     * @param Package[] $packages
292
     *
293
     * @return Shipment
294
     */
295
    public function setPackages(array $packages)
296
    {
297
        $this->packages = $packages;
298
299
        return $this;
300
    }
301
302
    /**
303
     * @return Service
304
     */
305
    public function getService()
306
    {
307
        return $this->service;
308
    }
309
310
    /**
311
     * @param Service $service
312
     *
313
     * @return Shipment
314
     */
315
    public function setService(Service $service)
316
    {
317
        $this->service = $service;
318
319
        return $this;
320
    }
321
322
    /**
323
     * @return ReturnService
324
     */
325
    public function getReturnService()
326
    {
327
        return $this->returnService;
328
    }
329
330
    /**
331
     * @param ReturnService $returnService
332
     *
333
     * @return Shipment
334
     */
335
    public function setReturnService(ReturnService $returnService)
336
    {
337
        $this->returnService = $returnService;
338
339
        return $this;
340
    }
341
342
    /**
343
     * @return ShipFrom
344
     */
345
    public function getShipFrom()
346
    {
347
        return $this->shipFrom;
348
    }
349
350
    /**
351
     * @param ShipFrom $shipFrom
352
     *
353
     * @return Shipment
354
     */
355
    public function setShipFrom(ShipFrom $shipFrom)
356
    {
357
        $this->shipFrom = $shipFrom;
358
359
        return $this;
360
    }
361
362
    /**
363
     * @return ShipTo
364
     */
365
    public function getShipTo()
366
    {
367
        return $this->shipTo;
368
    }
369
370
    /**
371
     * @param ShipTo $shipTo
372
     *
373
     * @return Shipment
374
     */
375
    public function setShipTo(ShipTo $shipTo)
376
    {
377
        $this->shipTo = $shipTo;
378
379
        return $this;
380
    }
381
382
    /**
383
     * @return SoldTo
384
     */
385
    public function getSoldTo()
386
    {
387
        return $this->soldTo;
388
    }
389
390
    /**
391
     * @param SoldTo $soldTo
392
     *
393
     * @return Shipment
394
     */
395
    public function setSoldTo(SoldTo $soldTo)
396
    {
397
        $this->soldTo = $soldTo;
398
399
        return $this;
400
    }
401
402
    /**
403
     * @return ShipmentServiceOptions
404
     */
405
    public function getShipmentServiceOptions()
406
    {
407
        return $this->shipmentServiceOptions;
408
    }
409
410
    /**
411
     * @param ShipmentServiceOptions $shipmentServiceOptions
412
     *
413
     * @return Shipment
414
     */
415
    public function setShipmentServiceOptions(ShipmentServiceOptions $shipmentServiceOptions)
416
    {
417
        $this->shipmentServiceOptions = $shipmentServiceOptions;
418
419
        return $this;
420
    }
421
422
    /**
423
     * @return Shipper
424
     */
425
    public function getShipper()
426
    {
427
        return $this->shipper;
428
    }
429
430
    /**
431
     * @param Shipper $shipper
432
     *
433
     * @return Shipment
434
     */
435
    public function setShipper(Shipper $shipper)
436
    {
437
        $this->shipper = $shipper;
438
439
        return $this;
440
    }
441
442
    /**
443
     * @return PaymentInformation
444
     */
445
    public function getPaymentInformation()
446
    {
447
        return $this->paymentInformation;
448
    }
449
450
    /**
451
     * @param PaymentInformation $paymentInformation
452
     *
453
     * @return Shipment
454
     */
455
    public function setPaymentInformation(PaymentInformation $paymentInformation)
456
    {
457
        $this->paymentInformation = $paymentInformation;
458
459
        return $this;
460
    }
461
462
    /**
463
     * @return ItemizedPaymentInformation
464
     */
465
    public function getItemizedPaymentInformation()
466
    {
467
        return $this->itemizedPaymentInformation;
468
    }
469
470
    /**
471
     * @param ItemizedPaymentInformation $itemizedPaymentInformation
472
     *
473
     * @return Shipment
474
     */
475
    public function setItemizedPaymentInformation(ItemizedPaymentInformation $itemizedPaymentInformation)
476
    {
477
        $this->itemizedPaymentInformation = $itemizedPaymentInformation;
478
479
        return $this;
480
    }
481
482
    /**
483
     * If called, returned prices will include negotiated rates (discounts will be applied).
484
     */
485
    public function showNegotiatedRates()
486
    {
487
        $this->rateInformation = new RateInformation();
488
        $this->rateInformation->setNegotiatedRatesIndicator(true);
489
    }
490
491
    /**
492
     * @return null|RateInformation
493
     */
494
    public function getRateInformation()
495
    {
496
        return $this->rateInformation;
497
    }
498
499
    /**
500
     * @param RateInformation $rateInformation
501
     *
502
     * @return Shipment
503
     */
504
    public function setRateInformation(RateInformation $rateInformation)
505
    {
506
        $this->rateInformation = $rateInformation;
507
508
        return $this;
509
    }
510
511
    /**
512
     * @return boolean
513
     */
514
    public function getGoodsNotInFreeCirculationIndicator()
515
    {
516
        return $this->goodsNotInFreeCirculationIndicator;
517
    }
518
519
    /**
520
     * @param boolean $goodsNotInFreeCirculationIndicator
521
     * @return Shipment
522
     */
523
    public function setGoodsNotInFreeCirculationIndicator($goodsNotInFreeCirculationIndicator)
524
    {
525
        $this->goodsNotInFreeCirculationIndicator = $goodsNotInFreeCirculationIndicator;
526
527
        return $this;
528
    }
529
530
    /**
531
     * @return string
532
     */
533
    public function getMovementReferenceNumber()
534
    {
535
        return $this->movementReferenceNumber;
536
    }
537
538
    /**
539
     * @param string $movementReferenceNumber
540
     * @return Shipment
541
     */
542
    public function setMovementReferenceNumber($movementReferenceNumber)
543
    {
544
        $this->movementReferenceNumber = $movementReferenceNumber;
545
546
        return $this;
547
    }
548
549
    /**
550
     * @return InvoiceLineTotal
551
     */
552
    public function getInvoiceLineTotal()
553
    {
554
        return $this->invoiceLineTotal;
555
    }
556
557
    /**
558
     * @param InvoiceLineTotal $invoiceLineTotal
559
     * @return Shipment
560
     */
561
    public function setInvoiceLineTotal(InvoiceLineTotal $invoiceLineTotal)
562
    {
563
        $this->invoiceLineTotal = $invoiceLineTotal;
564
565
        return $this;
566
    }
567
568
    /**
569
     * @return string
570
     */
571
    public function getNumOfPiecesInShipment()
572
    {
573
        return $this->numOfPiecesInShipment;
574
    }
575
576
    /**
577
     * @param string $numOfPiecesInShipment
578
     * @return Shipment
579
     */
580
    public function setNumOfPiecesInShipment($numOfPiecesInShipment)
581
    {
582
        $this->numOfPiecesInShipment = $numOfPiecesInShipment;
583
584
        return $this;
585
    }
586
587
    /**
588
     * @return DeliveryTimeInformation
589
     */
590
    public function getDeliveryTimeInformation()
591
    {
592
        return $this->deliveryTimeInformation;
593
    }
594
595
    /**
596
     * @param DeliveryTimeInformation $deliveryTimeInformation
597
     */
598
    public function setDeliveryTimeInformation(DeliveryTimeInformation $deliveryTimeInformation)
599
    {
600
        $this->deliveryTimeInformation = $deliveryTimeInformation;
601
    }
602
603
    /**
604
     * @return ShipmentTotalWeight
605
     */
606
    public function getShipmentTotalWeight()
607
    {
608
        return $this->shipmentTotalWeight;
609
    }
610
611
    /**
612
     * @param ShipmentTotalWeight $shipmentTotalWeight
613
     */
614
    public function setShipmentTotalWeight(ShipmentTotalWeight $shipmentTotalWeight)
615
    {
616
        $this->shipmentTotalWeight = $shipmentTotalWeight;
617
    }
618
619
    public function getTaxInformationIndicator(): bool
620
    {
621
        return $this->taxInformationIndicator;
622
    }
623
624
    /**
625
     * If called, returned prices will include Tax Information
626
     */
627
    public function setTaxInformationIndicator(bool $taxInformationIndicator): self
628
    {
629
        $this->taxInformationIndicator = $taxInformationIndicator;
630
        
631
        return $this;
632
    }
633
    
634
    /**
635
     * @return int $uspsEndorsement
636
     */
637
    public function getUSPSEndorsement()
638
    {
639
        return $this->uspsEndorsement;
640
    }
641
642
    /**
643
     * @param integer $uspsEndorsement
644
     *
645
     * @return Shipment
646
     */
647
    public function setUSPSEndorsement($uspsEndorsement)
648
    {
649
        $this->uspsEndorsement = $uspsEndorsement;
650
651
        return $this;
652
    }
653
654
    /**
655
     * @return int $packageId
656
     */
657
    public function getPackageId()
658
    {
659
        return $this->packageId;
660
    }
661
662
    /**
663
     * @param integer $packageId
664
     *
665
     * @return Shipment
666
     */
667
    public function setPackageId($packageId)
668
    {
669
        $this->packageId = $packageId;
0 ignored issues
show
Documentation Bug introduced by
The property $packageId was declared of type string, but $packageId is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
670
        
671
        return $this;
672
    }
673
}
674