1 | <?php |
||
27 | class Tax extends OrderTax implements ITax |
||
28 | { |
||
29 | use TInvoiceTextCodeContainer; |
||
30 | |||
31 | const ROOT_NODE = 'Tax'; |
||
32 | |||
33 | /** @var float */ |
||
34 | protected $exemptAmount; |
||
35 | /** @var float */ |
||
36 | protected $nonTaxableAmount; |
||
37 | |||
38 | /** |
||
39 | * @param IValidatorIterator |
||
40 | * @param ISchemaValidator |
||
41 | * @param IPayloadMap |
||
42 | * @param LoggerInterface |
||
43 | * @param IPayload |
||
44 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
||
45 | */ |
||
46 | public function __construct( |
||
47 | IValidatorIterator $validators, |
||
48 | ISchemaValidator $schemaValidator, |
||
49 | IPayloadMap $payloadMap, |
||
50 | LoggerInterface $logger, |
||
51 | IPayload $parentPayload = null |
||
52 | ) { |
||
53 | parent::__construct($validators, $schemaValidator, $payloadMap, $logger, $parentPayload); |
||
54 | |||
55 | $this->logger = $logger; |
||
|
|||
56 | $this->payloadMap = $payloadMap; |
||
57 | $this->payloadFactory = new PayloadFactory; |
||
58 | |||
59 | $this->optionalExtractionPaths = array_merge( |
||
60 | $this->optionalExtractionPaths, |
||
61 | [ |
||
62 | 'exemptAmount' => 'x:ExemptAmount', |
||
63 | 'nonTaxableAmount' => 'x:NonTaxableAmount', |
||
64 | ] |
||
65 | ); |
||
66 | $this->subpayloadExtractionPaths = [ |
||
67 | 'invoiceTextCodes' => 'x:InvoiceTextCodes', |
||
68 | ]; |
||
69 | |||
70 | $this->invoiceTextCodes = $this->buildPayloadForInterface(self::INVOICE_TEXT_CODE_ITERABLE_INTERFACE); |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * Amount of item amount not subject to taxes due to tax exempt status. |
||
75 | * |
||
76 | * @return float |
||
77 | */ |
||
78 | public function getExemptAmount() |
||
82 | |||
83 | /** |
||
84 | * @param float |
||
85 | * @return self |
||
86 | */ |
||
87 | public function setExemptAmount($exemptAmount) |
||
88 | { |
||
89 | $this->exemptAmount = $this->sanitizeAmount($exemptAmount); |
||
90 | return $this; |
||
91 | } |
||
92 | |||
93 | /** |
||
94 | * Amount of item amount not subject to taxes due to non-taxable status. |
||
95 | * |
||
96 | * @return float |
||
97 | */ |
||
98 | public function getNonTaxableAmount() |
||
102 | |||
103 | /** |
||
104 | * @param float |
||
105 | * @return self |
||
106 | */ |
||
107 | public function setNonTaxableAmount($nonTaxableAmount) |
||
112 | |||
113 | protected function serializeContents() |
||
126 | } |
||
127 |
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..