@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @param IPayloadFactory $payloadFactory |
35 | 35 | * @param array $messageMapping key/value pairs of config key => payload type |
36 | 36 | */ |
37 | - public function __construct(IPayloadFactory $payloadFactory = null, array $messageMapping = [], LoggerInterface $logger = null) |
|
37 | + public function __construct(IPayloadFactory $payloadFactory = null, array $messageMapping = [ ], LoggerInterface $logger = null) |
|
38 | 38 | { |
39 | 39 | $this->logger = $logger ?: new NullLogger(); |
40 | 40 | $this->payloadFactory = $payloadFactory ?: new PayloadFactory(); |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | |
44 | 44 | public function messagePayload($type) |
45 | 45 | { |
46 | - if (isset($this->messageTypeMap[$type])) { |
|
47 | - return $this->payloadFactory->buildPayload($this->messageTypeMap[$type], null, null, $this->logger); |
|
46 | + if (isset($this->messageTypeMap[ $type ])) { |
|
47 | + return $this->payloadFactory->buildPayload($this->messageTypeMap[ $type ], null, null, $this->logger); |
|
48 | 48 | } |
49 | 49 | throw new UnsupportedPayload("No payload found for '$type'"); |
50 | 50 | } |
@@ -511,8 +511,8 @@ |
||
511 | 511 | { |
512 | 512 | $isMockPayment = $this->getIsMockPayment(); |
513 | 513 | return !is_null($isMockPayment) |
514 | - ? ['isMockPayment' => $this->convertBooleanToString($isMockPayment)] |
|
515 | - : []; |
|
514 | + ? [ 'isMockPayment' => $this->convertBooleanToString($isMockPayment) ] |
|
515 | + : [ ]; |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | protected function getRootNodeName() |
@@ -272,14 +272,14 @@ |
||
272 | 272 | $linePrice = $this->getLinePrice(); |
273 | 273 | $amount = $this->getAmount(); |
274 | 274 | return array_merge( |
275 | - $name ? ['name' => $name] : [], |
|
276 | - $category ? ['category' => $category] : [], |
|
277 | - $isDiscount ? ['isDiscount' => $isDiscount] : [], |
|
278 | - $isPromotion ? ['isPromotion' => $isPromotion] : [], |
|
279 | - $informational ? ['informational' => $informational] : [], |
|
280 | - is_numeric($unitPrice) ? ['unitPrice' => $unitPrice] : [], |
|
281 | - is_numeric($linePrice) ? ['linePrice' => $linePrice] : [], |
|
282 | - is_numeric($amount) ? ['amount' => $amount] : [] |
|
275 | + $name ? [ 'name' => $name ] : [ ], |
|
276 | + $category ? [ 'category' => $category ] : [ ], |
|
277 | + $isDiscount ? [ 'isDiscount' => $isDiscount ] : [ ], |
|
278 | + $isPromotion ? [ 'isPromotion' => $isPromotion ] : [ ], |
|
279 | + $informational ? [ 'informational' => $informational ] : [ ], |
|
280 | + is_numeric($unitPrice) ? [ 'unitPrice' => $unitPrice ] : [ ], |
|
281 | + is_numeric($linePrice) ? [ 'linePrice' => $linePrice ] : [ ], |
|
282 | + is_numeric($amount) ? [ 'amount' => $amount ] : [ ] |
|
283 | 283 | ); |
284 | 284 | } |
285 | 285 | } |
@@ -212,10 +212,10 @@ |
||
212 | 212 | protected function getRootAttributes() |
213 | 213 | { |
214 | 214 | $name = $this->getName(); |
215 | - $adjustmentCategory = $this->getAdjustmentCategory();; |
|
215 | + $adjustmentCategory = $this->getAdjustmentCategory(); ; |
|
216 | 216 | return array_merge( |
217 | - $name ? ['name' => $name] : [], |
|
218 | - $adjustmentCategory ? ['adjustmentCategory' => $adjustmentCategory] : [] |
|
217 | + $name ? [ 'name' => $name ] : [ ], |
|
218 | + $adjustmentCategory ? [ 'adjustmentCategory' => $adjustmentCategory ] : [ ] |
|
219 | 219 | ); |
220 | 220 | } |
221 | 221 | } |
@@ -199,6 +199,6 @@ |
||
199 | 199 | protected function getRootAttributes() |
200 | 200 | { |
201 | 201 | $customerId = $this->getCustomerId(); |
202 | - return $customerId ? ['customerId' => $customerId] : []; |
|
202 | + return $customerId ? [ 'customerId' => $customerId ] : [ ]; |
|
203 | 203 | } |
204 | 204 | } |
@@ -418,10 +418,10 @@ |
||
418 | 418 | $derivedFromOrderHeaderKey = $this->getDerivedFromOrderHeaderKey(); |
419 | 419 | return array_merge( |
420 | 420 | parent::getRootAttributes(), |
421 | - !empty($hasChainedLines) ? ['hasChainedLines' => $hasChainedLines] : [], |
|
422 | - !empty($hasDerivedChild) ? ['hasDerivedChild' => $hasDerivedChild] : [], |
|
423 | - $chainedFromOrderHeaderKey ? ['chainedFromOrderHeaderKey' => $chainedFromOrderHeaderKey] : [], |
|
424 | - $derivedFromOrderHeaderKey ? ['derivedFromOrderHeaderKey' => $derivedFromOrderHeaderKey] : [] |
|
421 | + !empty($hasChainedLines) ? [ 'hasChainedLines' => $hasChainedLines ] : [ ], |
|
422 | + !empty($hasDerivedChild) ? [ 'hasDerivedChild' => $hasDerivedChild ] : [ ], |
|
423 | + $chainedFromOrderHeaderKey ? [ 'chainedFromOrderHeaderKey' => $chainedFromOrderHeaderKey ] : [ ], |
|
424 | + $derivedFromOrderHeaderKey ? [ 'derivedFromOrderHeaderKey' => $derivedFromOrderHeaderKey ] : [ ] |
|
425 | 425 | ); |
426 | 426 | } |
427 | 427 |
@@ -146,8 +146,8 @@ |
||
146 | 146 | { |
147 | 147 | $orderType = $this->getOrderType(); |
148 | 148 | return array_merge( |
149 | - ['xmlns' => $this->getXmlNamespace()], |
|
150 | - $orderType ? ['orderType' => $this->getOrderType()] : [] |
|
149 | + [ 'xmlns' => $this->getXmlNamespace() ], |
|
150 | + $orderType ? [ 'orderType' => $this->getOrderType() ] : [ ] |
|
151 | 151 | ); |
152 | 152 | } |
153 | 153 | } |
@@ -240,9 +240,9 @@ |
||
240 | 240 | { |
241 | 241 | $testType = $this->getTestType(); |
242 | 242 | return array_merge( |
243 | - ['xmlns' => $this->getXmlNamespace(), 'orderType' => $this->getOrderType()], |
|
244 | - $testType ? ['testType' => $testType] : [], |
|
245 | - ['cancellable' => $this->getCancellable()] |
|
243 | + [ 'xmlns' => $this->getXmlNamespace(), 'orderType' => $this->getOrderType() ], |
|
244 | + $testType ? [ 'testType' => $testType ] : [ ], |
|
245 | + [ 'cancellable' => $this->getCancellable() ] |
|
246 | 246 | ); |
247 | 247 | } |
248 | 248 | } |
@@ -706,10 +706,10 @@ |
||
706 | 706 | $hasChainedLines = $this->getHasChainedLines(); |
707 | 707 | $hasDerivedChild = $this->getHasDerivedChild(); |
708 | 708 | return array_merge( |
709 | - $customerOrderId ? ['customerOrderId' => $customerOrderId] : [], |
|
710 | - $levelOfService ? ['levelOfService' => $levelOfService] : [], |
|
711 | - !empty($hasChainedLines) ? ['hasChainedLines' => $hasChainedLines] : [], |
|
712 | - !empty($hasDerivedChild) ? ['hasDerivedChild' => $hasDerivedChild] : [] |
|
709 | + $customerOrderId ? [ 'customerOrderId' => $customerOrderId ] : [ ], |
|
710 | + $levelOfService ? [ 'levelOfService' => $levelOfService ] : [ ], |
|
711 | + !empty($hasChainedLines) ? [ 'hasChainedLines' => $hasChainedLines ] : [ ], |
|
712 | + !empty($hasDerivedChild) ? [ 'hasDerivedChild' => $hasDerivedChild ] : [ ] |
|
713 | 713 | ); |
714 | 714 | } |
715 | 715 |