@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->schemaValidator = $schemaValidator; |
| 52 | 52 | $this->parentPayload = $parentPayload; |
| 53 | 53 | $this->payloadMap = $payloadMap; |
| 54 | - $this->payloadFactory = new PayloadFactory(); |
|
| 54 | + $this->payloadFactory = new PayloadFactory(); |
|
| 55 | 55 | $this->setOrderSummaries($this->buildPayloadForInterface( |
| 56 | 56 | static::ORDER_SUMMARY_ITERABLE_INTERFACE |
| 57 | 57 | )); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | protected function getRootAttributes() |
| 121 | 121 | { |
| 122 | - return ['xmlns' => $this->getXmlNamespace()]; |
|
| 122 | + return [ 'xmlns' => $this->getXmlNamespace() ]; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | interface IBidirectionalMessageFactory extends IMessageFactory |
| 22 | 22 | { |
| 23 | - public function __construct(IConfig $config, IPayloadFactory $payloadFactory = null, array $messageMapping = [], LoggerInterface $logger = null); |
|
| 23 | + public function __construct(IConfig $config, IPayloadFactory $payloadFactory = null, array $messageMapping = [ ], LoggerInterface $logger = null); |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Returns a request payload object based on the configuration information passed in the constructor |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | */ |
| 104 | 104 | protected function getRootAttributes() |
| 105 | 105 | { |
| 106 | - return ['lineId' => $this->getId(), 'itemId' => $this->getItemId()]; |
|
| 106 | + return [ 'lineId' => $this->getId(), 'itemId' => $this->getItemId() ]; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -123,9 +123,9 @@ |
||
| 123 | 123 | */ |
| 124 | 124 | protected function getRootAttributes() |
| 125 | 125 | { |
| 126 | - $attrs = ['xmlns' => $this->getXmlNamespace()]; |
|
| 126 | + $attrs = [ 'xmlns' => $this->getXmlNamespace() ]; |
|
| 127 | 127 | if ($this->getReservationId()) { |
| 128 | - $attrs['reservationId'] = $this->cleanString($this->getReservationId(), 40); |
|
| 128 | + $attrs[ 'reservationId' ] = $this->cleanString($this->getReservationId(), 40); |
|
| 129 | 129 | } |
| 130 | 130 | return $attrs; |
| 131 | 131 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | $parentPayload |
| 55 | 55 | ); |
| 56 | 56 | |
| 57 | - unset($this->optionalExtractionPaths['shippingMethodMode']); |
|
| 58 | - unset($this->optionalExtractionPaths['shippingMethodDisplayText']); |
|
| 57 | + unset($this->optionalExtractionPaths[ 'shippingMethodMode' ]); |
|
| 58 | + unset($this->optionalExtractionPaths[ 'shippingMethodDisplayText' ]); |
|
| 59 | 59 | } |
| 60 | 60 | } |
@@ -274,8 +274,7 @@ |
||
| 274 | 274 | |
| 275 | 275 | protected function serializeDateTime($nodeName, $dateTime) |
| 276 | 276 | { |
| 277 | - return is_null($dateTime) ? "<{$nodeName}/>" : |
|
| 278 | - "<{$nodeName}>{$dateTime->format('c')}</{$nodeName}>"; |
|
| 277 | + return is_null($dateTime) ? "<{$nodeName}/>" : "<{$nodeName}>{$dateTime->format('c')}</{$nodeName}>"; |
|
| 279 | 278 | } |
| 280 | 279 | |
| 281 | 280 | protected function deserializeExtra() |
@@ -66,8 +66,7 @@ |
||
| 66 | 66 | |
| 67 | 67 | protected function serializeGiftWrapRequested() |
| 68 | 68 | { |
| 69 | - return is_null($this->getGiftWrapRequested()) ? '' : |
|
| 70 | - "<GiftwrapRequested>{$this->convertBooleanToString($this->getGiftWrapRequested())}</GiftwrapRequested>"; |
|
| 69 | + return is_null($this->getGiftWrapRequested()) ? '' : "<GiftwrapRequested>{$this->convertBooleanToString($this->getGiftWrapRequested())}</GiftwrapRequested>"; |
|
| 71 | 70 | } |
| 72 | 71 | |
| 73 | 72 | protected function serializeQuantity() |
@@ -17,19 +17,19 @@ |
||
| 17 | 17 | * Wrap include in a function to allow variables while protecting scope. |
| 18 | 18 | * @return array mapping of config keys to message payload types for bidirectional api operations |
| 19 | 19 | */ |
| 20 | -return call_user_func(function () { |
|
| 20 | +return call_user_func(function() { |
|
| 21 | 21 | $orderEvents = '\eBayEnterprise\RetailOrderManagement\Payload\OrderEvents'; |
| 22 | - $map = []; |
|
| 23 | - $map['OrderAccepted'] = "$orderEvents\OrderAccepted"; |
|
| 24 | - $map['OrderBackorder'] = "$orderEvents\OrderBackorder"; |
|
| 25 | - $map['OrderCancelled'] = "$orderEvents\OrderCancel"; |
|
| 26 | - $map['OrderConfirmed'] = "$orderEvents\OrderConfirmed"; |
|
| 27 | - $map['OrderCreditIssued'] = "$orderEvents\OrderCreditIssued"; |
|
| 28 | - $map['OrderGiftCardActivation'] = "$orderEvents\OrderGiftCardActivation"; |
|
| 29 | - $map['OrderPriceAdjustment'] = "$orderEvents\OrderPriceAdjustment"; |
|
| 30 | - $map['OrderRejected'] = "$orderEvents\OrderRejected"; |
|
| 31 | - $map['OrderReturnInTransit'] = "$orderEvents\OrderReturnInTransit"; |
|
| 32 | - $map['OrderShipped'] = "$orderEvents\OrderShipped"; |
|
| 33 | - $map['Test'] = "$orderEvents\TestMessage"; |
|
| 22 | + $map = [ ]; |
|
| 23 | + $map[ 'OrderAccepted' ] = "$orderEvents\OrderAccepted"; |
|
| 24 | + $map[ 'OrderBackorder' ] = "$orderEvents\OrderBackorder"; |
|
| 25 | + $map[ 'OrderCancelled' ] = "$orderEvents\OrderCancel"; |
|
| 26 | + $map[ 'OrderConfirmed' ] = "$orderEvents\OrderConfirmed"; |
|
| 27 | + $map[ 'OrderCreditIssued' ] = "$orderEvents\OrderCreditIssued"; |
|
| 28 | + $map[ 'OrderGiftCardActivation' ] = "$orderEvents\OrderGiftCardActivation"; |
|
| 29 | + $map[ 'OrderPriceAdjustment' ] = "$orderEvents\OrderPriceAdjustment"; |
|
| 30 | + $map[ 'OrderRejected' ] = "$orderEvents\OrderRejected"; |
|
| 31 | + $map[ 'OrderReturnInTransit' ] = "$orderEvents\OrderReturnInTransit"; |
|
| 32 | + $map[ 'OrderShipped' ] = "$orderEvents\OrderShipped"; |
|
| 33 | + $map[ 'Test' ] = "$orderEvents\TestMessage"; |
|
| 34 | 34 | return $map; |
| 35 | 35 | }); |
@@ -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 | } |