@@ -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 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | * @throws InvalidRequestException |
44 | 44 | */ |
45 | 45 | public function requires($paramKey) { |
46 | - if (! isset($this->params[$paramKey])) { |
|
46 | + if (!isset($this->params[$paramKey])) { |
|
47 | 47 | throw new InvalidRequestException($paramKey.' is required'); |
48 | 48 | } |
49 | 49 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | public function distillResponse(array $response): array |
31 | 31 | { |
32 | - if (! isset($response['@attributes']['totalResultsAvailable'])) { |
|
32 | + if (!isset($response['@attributes']['totalResultsAvailable'])) { |
|
33 | 33 | throw new ApiException('予期しないエラー'); |
34 | 34 | } |
35 | 35 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | throw new LogicException('seller_id is already set.'); |
21 | 21 | } |
22 | 22 | |
23 | - if (! preg_match('/^[a-z0-9\-]{3,20}$/', $sellerId)) { |
|
23 | + if (!preg_match('/^[a-z0-9\-]{3,20}$/', $sellerId)) { |
|
24 | 24 | throw new InvalidArgumentException; |
25 | 25 | } |
26 | 26 | |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | throw new LogicException('item_code is already set.'); |
42 | 42 | } |
43 | 43 | |
44 | - if (! preg_match('/^[a-zA-Z0-9\-]{1,99}$/', $itemCode)) { |
|
44 | + if (!preg_match('/^[a-zA-Z0-9\-]{1,99}$/', $itemCode)) { |
|
45 | 45 | throw new InvalidRequestException('item_code error.'); |
46 | 46 | } |
47 | 47 | $this->params['item_code'] = $itemCode; |
48 | 48 | |
49 | 49 | if (strlen($subCode)) { |
50 | - if (! preg_match('/^[a-zA-Z0-9\-]{1,99}$/', $subCode)) { |
|
50 | + if (!preg_match('/^[a-zA-Z0-9\-]{1,99}$/', $subCode)) { |
|
51 | 51 | throw new InvalidRequestException('sub_code error.'); |
52 | 52 | } |
53 | 53 | $this->params['item_code'] = $this->params['item_code'].':'.$subCode; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | throw new LogicException('quantity is already set.'); |
68 | 68 | } |
69 | 69 | |
70 | - if (! preg_match('/^((\+|-)?[0-9]{1,9}|INI)$/', $quantity)) { |
|
70 | + if (!preg_match('/^((\+|-)?[0-9]{1,9}|INI)$/', $quantity)) { |
|
71 | 71 | throw new InvalidRequestException('Only number or INI can be set.'); |
72 | 72 | } |
73 | 73 | |
@@ -106,15 +106,15 @@ discard block |
||
106 | 106 | */ |
107 | 107 | private function validateRequest(): void |
108 | 108 | { |
109 | - if (! isset($this->params['seller_id'])) { |
|
109 | + if (!isset($this->params['seller_id'])) { |
|
110 | 110 | throw new InvalidRequestException('seller_id is not set.'); |
111 | 111 | } |
112 | 112 | |
113 | - if (! isset($this->params['item_code'])) { |
|
113 | + if (!isset($this->params['item_code'])) { |
|
114 | 114 | throw new InvalidRequestException('item_code is not set.'); |
115 | 115 | } |
116 | 116 | |
117 | - if (! isset($this->params['quantity'])) { |
|
117 | + if (!isset($this->params['quantity'])) { |
|
118 | 118 | throw new InvalidRequestException('quantity is not set.'); |
119 | 119 | } |
120 | 120 | } |