@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
| 138 | - * @return \Requests_Response |
|
| 138 | + * @return boolean |
|
| 139 | 139 | * @throws \Requests_Exception |
| 140 | 140 | */ |
| 141 | 141 | protected function post() |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /** |
| 175 | - * @return \Requests_Response |
|
| 175 | + * @return boolean |
|
| 176 | 176 | * @throws \Requests_Exception |
| 177 | 177 | */ |
| 178 | 178 | protected function get() |
@@ -204,6 +204,9 @@ discard block |
||
| 204 | 204 | * @param string |
| 205 | 205 | * @param string |
| 206 | 206 | * @param string |
| 207 | + * @param string $xmlPayload |
|
| 208 | + * @param string $logMessage |
|
| 209 | + * @param string $key |
|
| 207 | 210 | * @return self |
| 208 | 211 | */ |
| 209 | 212 | protected function logPayloadMessage($xmlPayload, $logMessage, $key) |
@@ -187,8 +187,8 @@ |
||
| 187 | 187 | protected function getRequestUrlLogData() |
| 188 | 188 | { |
| 189 | 189 | $context = $this->getContext(); |
| 190 | - $logData = ['rom_request_url' => $this->config->getEndpoint()]; |
|
| 191 | - return $context ? $context->getMetaData(__CLASS__, $logData) : []; |
|
| 190 | + $logData = [ 'rom_request_url' => $this->config->getEndpoint() ]; |
|
| 191 | + return $context ? $context->getMetaData(__CLASS__, $logData) : [ ]; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | protected function logRequestUrl() |
@@ -432,6 +432,8 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | /** |
| 434 | 434 | * Serialize the chain order node. |
| 435 | + * @param string $node |
|
| 436 | + * @param string|null $value |
|
| 435 | 437 | * @return string | null |
| 436 | 438 | */ |
| 437 | 439 | protected function serializeChainedOrder($node, $value) |
@@ -445,6 +447,8 @@ discard block |
||
| 445 | 447 | |
| 446 | 448 | /** |
| 447 | 449 | * Serialize the derived order node. |
| 450 | + * @param string $node |
|
| 451 | + * @param string|null $value |
|
| 448 | 452 | * @return string | null |
| 449 | 453 | */ |
| 450 | 454 | protected function serializeDerivedOrder($node, $value) |
@@ -481,12 +481,12 @@ |
||
| 481 | 481 | $testType = $this->getTestType(); |
| 482 | 482 | $cancellable = $this->getCancellable(); |
| 483 | 483 | return array_merge( |
| 484 | - ['id' => $this->getId()], |
|
| 485 | - $orderType ? ['orderType' => $orderType] : [], |
|
| 486 | - $orderPurpose ? ['orderPurpose' => $orderPurpose] : [], |
|
| 487 | - $testType ? ['testType' => $testType] : [], |
|
| 488 | - ['modifiedTime' => $this->getModifiedTime()->format('c')], |
|
| 489 | - $cancellable ? ['cancellable' => $cancellable] : [] |
|
| 484 | + [ 'id' => $this->getId() ], |
|
| 485 | + $orderType ? [ 'orderType' => $orderType ] : [ ], |
|
| 486 | + $orderPurpose ? [ 'orderPurpose' => $orderPurpose ] : [ ], |
|
| 487 | + $testType ? [ 'testType' => $testType ] : [ ], |
|
| 488 | + [ 'modifiedTime' => $this->getModifiedTime()->format('c') ], |
|
| 489 | + $cancellable ? [ 'cancellable' => $cancellable ] : [ ] |
|
| 490 | 490 | ); |
| 491 | 491 | } |
| 492 | 492 | } |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | /** |
| 119 | 119 | * @see eBayEnterprise\RetailOrderManagement\Payload\TPayload::getXmlNamespace |
| 120 | 120 | * @param string |
| 121 | - * @return self |
|
| 121 | + * @return string |
|
| 122 | 122 | */ |
| 123 | 123 | protected function getXmlNamespace() |
| 124 | 124 | { |
@@ -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 | /** |
@@ -272,6 +272,10 @@ |
||
| 272 | 272 | . '</DeliveryEstimate>'; |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | + /** |
|
| 276 | + * @param string $nodeName |
|
| 277 | + * @param DateTime $dateTime |
|
| 278 | + */ |
|
| 275 | 279 | protected function serializeDateTime($nodeName, $dateTime) |
| 276 | 280 | { |
| 277 | 281 | return is_null($dateTime) ? "<{$nodeName}/>" : |
@@ -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() |
@@ -136,6 +136,7 @@ |
||
| 136 | 136 | * @param DOMNodeList |
| 137 | 137 | * @param IItemIterable |
| 138 | 138 | * @param string |
| 139 | + * @param string $subPayloadMethod |
|
| 139 | 140 | * @return self |
| 140 | 141 | */ |
| 141 | 142 | protected function deserializeItems(DOMNodeList $itemNodes, IItemIterable $iterable, $subPayloadMethod) |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | /** |
| 59 | 59 | * Get a new, empty item for shipping. |
| 60 | 60 | * |
| 61 | - * @return IShippingItemIterable |
|
| 61 | + * @return IPayload |
|
| 62 | 62 | */ |
| 63 | 63 | public function getEmptyShippingItem() |
| 64 | 64 | { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** |
| 69 | 69 | * Get a new, empty item for in store pick up. |
| 70 | 70 | * |
| 71 | - * @return IInStorePickUpItemIterable |
|
| 71 | + * @return IPayload |
|
| 72 | 72 | */ |
| 73 | 73 | public function getEmptyInStorePickUpItem() |
| 74 | 74 | { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | /** |
| 79 | 79 | * Get a new, empty payload for an unavailable item. |
| 80 | 80 | * |
| 81 | - * @return IShippingItemIterable |
|
| 81 | + * @return IPayload |
|
| 82 | 82 | */ |
| 83 | 83 | public function getEmptyDetailItem() |
| 84 | 84 | { |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | /** |
| 89 | 89 | * Get a new, empty payload for an unavailable item. |
| 90 | 90 | * |
| 91 | - * @return IShippingItemIterable |
|
| 91 | + * @return IPayload |
|
| 92 | 92 | */ |
| 93 | 93 | public function getEmptyUnavailableItem() |
| 94 | 94 | { |
@@ -30,7 +30,6 @@ |
||
| 30 | 30 | protected $logger; |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | - * @param IConfig $config |
|
| 34 | 33 | * @param IPayloadFactory $payloadFactory |
| 35 | 34 | * @param array $messageMapping key/value pairs of config key => payload type |
| 36 | 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 | } |
@@ -408,6 +408,8 @@ discard block |
||
| 408 | 408 | * |
| 409 | 409 | * @param string |
| 410 | 410 | * @param mixed |
| 411 | + * @param string $nodeName |
|
| 412 | + * @param double $value |
|
| 411 | 413 | * @return string | null |
| 412 | 414 | */ |
| 413 | 415 | protected function serializeOptionalNumericValue($nodeName, $value) |
@@ -421,6 +423,9 @@ discard block |
||
| 421 | 423 | * @param string |
| 422 | 424 | * @param string |
| 423 | 425 | * @param string |
| 426 | + * @param string $nodeName |
|
| 427 | + * @param string $value |
|
| 428 | + * @param string $description |
|
| 424 | 429 | * @return string | null |
| 425 | 430 | */ |
| 426 | 431 | protected function serializeLineStatusValue($nodeName, $value, $description) |
@@ -205,6 +205,7 @@ |
||
| 205 | 205 | * |
| 206 | 206 | * @param string |
| 207 | 207 | * @param string |
| 208 | + * @param string $nodeName |
|
| 208 | 209 | * @return string | null |
| 209 | 210 | */ |
| 210 | 211 | protected function serializeBillingAddressValue($nodeName) |