Completed
Pull Request — master (#202)
by
unknown
03:30
created

setSplitDutyVATIndicator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 3
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Ups\Entity;
4
5
use LogicException;
6
7
class ItemizedPaymentInformation
8
{
9
10
    /**
11
     * @var splitDutyVATIndicator 
12
     */
13
    private $splitDutyVATIndicator;
14
    private $transportationShipmentCharge = null; 
15
    private $dutiesAndTaxesShipmentCharge = null; 
16
17
    public function __construct($attributes = null)
0 ignored issues
show
Unused Code introduced by
The parameter $attributes 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...
18
    {
19
    }
20
21
    /**
22
     * @return transportationShipmentCharge
23
     */
24
    public function getTransportationShipmentCharge()
25
    {
26
        return $this->transportationShipmentCharge;
27
    }
28
29
    /**
30
     * @param ShipmentCharge $shipmentCharge
31
     * @return ItemizedPaymentInformation
32
     */
33
    public function setShipmentCharge(ShipmentCharge $shipmentCharge)
34
    {
35
        if ($shipmentCharge->getType() == ShipmentCharge::SHIPMENT_CHARGE_TYPE_TRANSPORTATION) { 
36
           $this->transportationShipmentCharge = $shipmentCharge;
37
        } else if ($shipmentCharge->getType() == ShipmentCharge::SHIPMENT_CHARGE_TYPE_DUTIES) { 
38
            $this->dutiesAndTaxesShipmentCharge = $shipmentCharge;
39
        } else {
40
            throw new LogicException(sprintf('Unknown ShipmentCharge charge type requested: "%s"', $type));
41
        }
42
        return $this;
43
    }
44
45
    /**
46
     * @return dutiesAndTaxesShipmentCharge
47
     */
48
    public function getDutiesAndTaxesShipmentCharge()
49
    {
50
        return $this->dutiesAndTaxesShipmentCharge;
51
    }
52
53
    /**
54
     * @return splitDutyVATIndicator
55
     */
56
    public function getSplitDutyVATIndicator()
57
    {
58
        return $this->splitDutyVATIndicator;
59
    }
60
61
    /**
62
     * @param splitDutyVATIndicator $splitDutyVATIndicator
63
     * @return ItemizedPaymentInformation
64
     */
65
    public function setSplitDutyVATIndicator($splitDutyVATIndicator)
66
    {
67
        $this->splitDutyVATIndicator = $splitDutyVATIndicator;
68
69
        return $this;
70
    }
71
}
72