@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | var_dump($response); |
| 36 | 36 | |
| 37 | -}catch (Exception $e){ |
|
| 37 | +} catch (Exception $e){ |
|
| 38 | 38 | echo $e->getFile()."\n"; |
| 39 | 39 | echo $e->getLine()."\n"; |
| 40 | 40 | echo $e->getCode().':'.$e->getMessage()."\n"; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | //kanazawa test |
| 3 | 3 | |
| 4 | -require_once __DIR__ . '/vendor/autoload.php'; |
|
| 4 | +require_once __DIR__.'/vendor/autoload.php'; |
|
| 5 | 5 | |
| 6 | 6 | use Shippinno\YahooShoppingJp\Client; |
| 7 | 7 | use Shippinno\YahooShoppingJp\Enum\ShipStatus; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | define('YAHOO_APP_ID', 'dj0zaiZpPUZFNTFuUUQ3Q2piSSZzPWNvbnN1bWVyc2VjcmV0Jng9MWY-'); |
| 12 | 12 | define('YAHOO_SECRET', 'a71d10c84a7826c7f98aae379f4d33607dff4a87'); |
| 13 | -$seller_id = 'snbx-nxpqe5hm3'; |
|
| 13 | +$seller_id = 'snbx-nxpqe5hm3'; |
|
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | $client = new Client( |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | file_get_contents(__DIR__.'/refresh_token.txt') |
| 19 | 19 | ); |
| 20 | 20 | |
| 21 | -try{ |
|
| 21 | +try { |
|
| 22 | 22 | $request = new UpdateOrderShippingStatusRequest(); |
| 23 | 23 | |
| 24 | 24 | $request = $request |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | var_dump($response); |
| 33 | 33 | |
| 34 | -}catch (Exception $e){ |
|
| 34 | +} catch (Exception $e) { |
|
| 35 | 35 | echo $e->getFile()."\n"; |
| 36 | 36 | echo $e->getLine()."\n"; |
| 37 | 37 | echo $e->getCode().':'.$e->getMessage()."\n"; |
@@ -11,17 +11,17 @@ discard block |
||
| 11 | 11 | use Shippinno\YahooShoppingJp\Enum\CancelReason; |
| 12 | 12 | |
| 13 | 13 | define('YAHOO_APP_ID', |
| 14 | - 'dj0zaiZpPUZFNTFuUUQ3Q2piSSZzPWNvbnN1bWVyc2VjcmV0Jng9MWY-'); |
|
| 14 | + 'dj0zaiZpPUZFNTFuUUQ3Q2piSSZzPWNvbnN1bWVyc2VjcmV0Jng9MWY-'); |
|
| 15 | 15 | define('YAHOO_SECRET', |
| 16 | - 'a71d10c84a7826c7f98aae379f4d33607dff4a87'); |
|
| 16 | + 'a71d10c84a7826c7f98aae379f4d33607dff4a87'); |
|
| 17 | 17 | $accessToken = 'dw_bcoYMsYi_ahYU5.6vkn.vTk6Y6nF74YIw82P4dLoHjR8eRrEGMbKS9YYB1f6F95sgm3Z4d0FSWfrNYCb0EdxE02CFVz..4daPOZKt9Ud3dZ1ewLt7.TYDbkbjywzinO1qnH1Z4QdPaenDtNK.JVILPbTpJHIgmdatCFHX7ea_hFPfRl04Z7xuXaCE9NcH6ICdAYMaC2NE6N4Dg6hnY3sTJpwVGPCEc10GBcVLB7j2CTflK4rN0Vmmj2mdxCZqrE3jYh0AqtsfOpSqhXoHIBsepx5P7YiGtTclX_Uh0LpzDkTlpZJ7Si66zl4LOEkFASJHtU86bRosDPu3ISGDlf1ar61fJvf9q9Z94dXGJaIKRXpO2xFERGEOEH0FWUSzWeouJR0DZlnsAjvt2lT1wKBJH9IceNutTFdBe8ypIlkjlIRjyBc2jjVA6nz4.4E1DIRwTydYmZmbqnWqdp8oEuwX2Cd9QCGOjC9CWI2uHhCAx_bGm6GlPhNO.agutvX6zSzl.UdsU9JrDexi8XEg1FQ9s.EqownBSa8Uoh9dSUiMz8h4E8MyKM65d9e9csOzWTDqOkWeVGpIE5w60T8DmoI06nTCmgrACEk4jQaftj72fvX7uz.zTU4yUFYfUGi290XfPaIPMm.u33iI'; |
| 18 | 18 | $refreshToken = ''; |
| 19 | 19 | $seller_id = 'snbx-nxpqe5hm3'; |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | $client = new Client( |
| 23 | - $accessToken, |
|
| 24 | - $refreshToken); |
|
| 23 | + $accessToken, |
|
| 24 | + $refreshToken); |
|
| 25 | 25 | // file_get_contents(__DIR__ . '/access_token.txt'), |
| 26 | 26 | // file_get_contents(__DIR__ . '/refresh_token.txt') |
| 27 | 27 | //); |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | $client->setApi($factory->api()); |
| 32 | 32 | $request = $factory->request(); |
| 33 | 33 | $request->setSellerId($seller_id) |
| 34 | - ->setIsPointFix(false) |
|
| 35 | - ->setOrderStatus(OrderStatus::PROCESSED()) |
|
| 36 | - ->setOrderId('snbx-nxpqe5hm3-10000045'); |
|
| 34 | + ->setIsPointFix(false) |
|
| 35 | + ->setOrderStatus(OrderStatus::PROCESSED()) |
|
| 36 | + ->setOrderId('snbx-nxpqe5hm3-10000045'); |
|
| 37 | 37 | |
| 38 | 38 | $response = $client->execute($request); |
| 39 | 39 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | { |
| 51 | 51 | if (null === $httpClient) { |
| 52 | 52 | $httpClient = new HttpClient([ |
| 53 | - 'base_uri' => self::BASE_URL, |
|
| 53 | + 'base_uri' => self::BASE_URL, |
|
| 54 | 54 | ]); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | { |
| 76 | 76 | $options = []; |
| 77 | 77 | $options = $this->setRequestParams( |
| 78 | - $options, |
|
| 79 | - $request); |
|
| 78 | + $options, |
|
| 79 | + $request); |
|
| 80 | 80 | $options = $this->setAuthorizationHeader($options); |
| 81 | 81 | $rawResponse = $this->request($options); |
| 82 | 82 | $response = $this->decodeResponse($rawResponse); |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | if ($this->api->httpMethod()->equals(HttpMethod::GET())) { |
| 95 | 95 | $options = $this->setRequestParamsForGetRequest($options, |
| 96 | - $request); |
|
| 96 | + $request); |
|
| 97 | 97 | } |
| 98 | 98 | elseif ($this->api->httpMethod()->equals(HttpMethod::POST())) { |
| 99 | 99 | $options = $this->setRequestParamsForPostRequest($options, |
| 100 | - $request); |
|
| 100 | + $request); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | return $options; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | private function setAuthorizationHeader(array $options): array |
| 139 | 139 | { |
| 140 | 140 | $options['headers'] = [ |
| 141 | - 'Authorization' => 'Bearer ' . $this->accessToken, |
|
| 141 | + 'Authorization' => 'Bearer ' . $this->accessToken, |
|
| 142 | 142 | ]; |
| 143 | 143 | |
| 144 | 144 | return $options; |
@@ -164,14 +164,14 @@ discard block |
||
| 164 | 164 | private function decodeResponse(ResponseInterface $rawResponse): array |
| 165 | 165 | { |
| 166 | 166 | return json_decode( |
| 167 | - json_encode( |
|
| 167 | + json_encode( |
|
| 168 | 168 | simplexml_load_string( |
| 169 | - $rawResponse->getBody()->getContents(), |
|
| 170 | - null, |
|
| 171 | - LIBXML_NOCDATA |
|
| 169 | + $rawResponse->getBody()->getContents(), |
|
| 170 | + null, |
|
| 171 | + LIBXML_NOCDATA |
|
| 172 | 172 | ) |
| 173 | - ), |
|
| 174 | - true |
|
| 173 | + ), |
|
| 174 | + true |
|
| 175 | 175 | ); |
| 176 | 176 | } |
| 177 | 177 | |
@@ -138,7 +138,7 @@ |
||
| 138 | 138 | private function setAuthorizationHeader(array $options): array |
| 139 | 139 | { |
| 140 | 140 | $options['headers'] = [ |
| 141 | - 'Authorization' => 'Bearer ' . $this->accessToken, |
|
| 141 | + 'Authorization' => 'Bearer '.$this->accessToken, |
|
| 142 | 142 | ]; |
| 143 | 143 | |
| 144 | 144 | return $options; |
@@ -94,8 +94,7 @@ |
||
| 94 | 94 | if ($this->api->httpMethod()->equals(HttpMethod::GET())) { |
| 95 | 95 | $options = $this->setRequestParamsForGetRequest($options, |
| 96 | 96 | $request); |
| 97 | - } |
|
| 98 | - elseif ($this->api->httpMethod()->equals(HttpMethod::POST())) { |
|
| 97 | + } elseif ($this->api->httpMethod()->equals(HttpMethod::POST())) { |
|
| 99 | 98 | $options = $this->setRequestParamsForPostRequest($options, |
| 100 | 99 | $request); |
| 101 | 100 | } |
@@ -120,7 +120,7 @@ |
||
| 120 | 120 | throw new LogicException('ShipNotes is already set.'); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if(strlen($shipNotes) > 500){ |
|
| 123 | + if (strlen($shipNotes) > 500) { |
|
| 124 | 124 | throw new InvalidArgumentException('ShipNotes is invalid.'); |
| 125 | 125 | } |
| 126 | 126 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function distillResponse(array $response): array |
| 30 | 30 | { |
| 31 | - if(! isset($response['Result']['Status']) |
|
| 31 | + if (!isset($response['Result']['Status']) |
|
| 32 | 32 | || $response['Result']['Status'] !== 'OK') { |
| 33 | 33 | throw new DistillationException; |
| 34 | 34 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $this->assertSame($request, $request->setSellerId('VALID_SELLER_ID')); |
| 31 | 31 | |
| 32 | 32 | for ($i = 1; $i <= 1001; $i++) { |
| 33 | - $request->addItemCode('AN_ITEM_CODE_' . $i); |
|
| 33 | + $request->addItemCode('AN_ITEM_CODE_'.$i); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | $request->getParams(); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once __DIR__ . '/vendor/autoload.php'; |
|
| 3 | +require_once __DIR__.'/vendor/autoload.php'; |
|
| 4 | 4 | |
| 5 | 5 | |
| 6 | 6 | use Shippinno\YahooShoppingJp\Factory\GetItemStockInfoFactory; |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function distillResponse(array $response): array |
| 30 | 30 | { |
| 31 | - if(! isset($response['Result'])) { |
|
| 31 | + if (!isset($response['Result'])) { |
|
| 32 | 32 | throw new DistillationException; |
| 33 | 33 | } |
| 34 | 34 | |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | */ |
| 65 | 65 | private function validateRequest(): void |
| 66 | 66 | { |
| 67 | - if (! isset($this->params['seller_id'])) { |
|
| 67 | + if (!isset($this->params['seller_id'])) { |
|
| 68 | 68 | throw new InvalidRequestException; |
| 69 | 69 | } |
| 70 | 70 | |