@@ -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 | $factory = new UpdateOrderShippingStatusFactory(); |
| 23 | 23 | |
| 24 | 24 | $client->setApi($factory->api()); |
@@ -34,7 +34,7 @@ discard block |
||
| 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"; |
@@ -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"; |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | throw new LogicException('ShipMethod is already set.'); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if(!preg_match('/^postage(\d+)$/',$shipMethod,$m) |
|
| 105 | - || !in_array($m[1],['1','2','3','4','5','6','7','8', |
|
| 106 | - '9','10','11','12','13','14','16'])){ |
|
| 104 | + if (!preg_match('/^postage(\d+)$/', $shipMethod, $m) |
|
| 105 | + || !in_array($m[1], ['1', '2', '3', '4', '5', '6', '7', '8', |
|
| 106 | + '9', '10', '11', '12', '13', '14', '16'])) { |
|
| 107 | 107 | throw new InvalidArgumentException('ShipMethod is invalid.'); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | throw new LogicException('ShipNotes is already set.'); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - if(strlen($shipNotes) > 500){ |
|
| 125 | + if (strlen($shipNotes) > 500) { |
|
| 126 | 126 | throw new InvalidArgumentException('ShipNotes is invalid.'); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -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 | throw new DistillationException; |
| 33 | 33 | } |
| 34 | 34 | |