@@ -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() |
@@ -103,6 +103,7 @@ |
||
| 103 | 103 | * |
| 104 | 104 | * @param string |
| 105 | 105 | * @param string |
| 106 | + * @param string $name |
|
| 106 | 107 | * @return string |
| 107 | 108 | */ |
| 108 | 109 | abstract protected function serializeOptionalXmlEncodedValue($name, $value); |
@@ -179,6 +179,7 @@ |
||
| 179 | 179 | * encode the passed in string to be safe for xml if it is not null, |
| 180 | 180 | * otherwise simply return the null parameter. |
| 181 | 181 | * @param mixed $value |
| 182 | + * @param string $name |
|
| 182 | 183 | * @return string | null |
| 183 | 184 | */ |
| 184 | 185 | abstract protected function serializeOptionalXmlEncodedValue($name, $value); |
@@ -91,12 +91,12 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | protected function serializePhysicalAddress() |
| 93 | 93 | { |
| 94 | - $lines = []; |
|
| 94 | + $lines = [ ]; |
|
| 95 | 95 | $idx = 0; |
| 96 | - $addressLines = is_array($this->lines) ? $this->lines : []; |
|
| 96 | + $addressLines = is_array($this->lines) ? $this->lines : [ ]; |
|
| 97 | 97 | foreach ($addressLines as $line) { |
| 98 | 98 | $idx++; |
| 99 | - $lines[] = sprintf( |
|
| 99 | + $lines[ ] = sprintf( |
|
| 100 | 100 | '<Line%d>%s</Line%1$d>', |
| 101 | 101 | $idx, |
| 102 | 102 | $this->xmlEncode($line) |
@@ -143,14 +143,14 @@ discard block |
||
| 143 | 143 | $trimmed = trim($lines); |
| 144 | 144 | $addressLines = preg_split("/\n/", $trimmed, null, PREG_SPLIT_NO_EMPTY); |
| 145 | 145 | |
| 146 | - $newLines = []; |
|
| 146 | + $newLines = [ ]; |
|
| 147 | 147 | foreach ($addressLines as $line) { |
| 148 | - $newLines[] = $this->cleanString($line, 70); |
|
| 148 | + $newLines[ ] = $this->cleanString($line, 70); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | if (count($newLines) > 4) { |
| 152 | 152 | // concat lines beyond the four allowed down into the last line |
| 153 | - $newLines[3] = $this->cleanString(implode(' ', array_slice($newLines, 3)), 70); |
|
| 153 | + $newLines[ 3 ] = $this->cleanString(implode(' ', array_slice($newLines, 3)), 70); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | $finalLines = array_slice($newLines, 0, 4); |
@@ -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 | } |