@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | foreach (explode('.', $item) as $segment) { |
| 53 | - if (! is_array($decoded) || ! array_key_exists($segment, $decoded)) { |
|
| 53 | + if (!is_array($decoded) || !array_key_exists($segment, $decoded)) { |
|
| 54 | 54 | return $default; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | try { |
| 81 | 81 | return $this->decoded = \GuzzleHttp\json_decode( |
| 82 | - (string) $this->getHttpResponse()->getBody(), |
|
| 82 | + (string)$this->getHttpResponse()->getBody(), |
|
| 83 | 83 | true |
| 84 | 84 | ); |
| 85 | 85 | } catch (\InvalidArgumentException $e) { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | $response = $this->process($request); |
| 37 | 37 | |
| 38 | - if (! $response->successful()) { |
|
| 38 | + if (!$response->successful()) { |
|
| 39 | 39 | throw new FailedRequestException('Failed request. ' . $response->getHttpResponse()->getReasonPhrase()); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | protected function createCollection($items, GenericResource $prototype = null) |
| 62 | 62 | { |
| 63 | - if (! $prototype) { |
|
| 63 | + if (!$prototype) { |
|
| 64 | 64 | $prototype = new GenericResource(); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | */ |
| 63 | 63 | public function update($pageId, GenericResource $page) |
| 64 | 64 | { |
| 65 | - $request = new PutJson('/admin/pages/' . $pageId. '.json', array('page' => $page->toArray())); |
|
| 65 | + $request = new PutJson('/admin/pages/' . $pageId . '.json', array('page' => $page->toArray())); |
|
| 66 | 66 | $response = $this->send($request); |
| 67 | 67 | return $this->createEntity($response->get('page')); |
| 68 | 68 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | $handlers = HandlerStack::create(); |
| 21 | 21 | $handlers->push(Middleware::retry( |
| 22 | - function ($retries, RequestInterface $request, ResponseInterface $response = null, \Exception $error = null) { |
|
| 22 | + function($retries, RequestInterface $request, ResponseInterface $response = null, \Exception $error = null) { |
|
| 23 | 23 | |
| 24 | 24 | // todo rate limit by this |
| 25 | 25 | //$response->getHeaderLine('X-Shopify-Shop-Api-Call-Limit'); |
@@ -29,15 +29,15 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | return false; |
| 31 | 31 | }, |
| 32 | - function ($retries, ResponseInterface $response) { |
|
| 32 | + function($retries, ResponseInterface $response) { |
|
| 33 | 33 | if (!$response->hasHeader('Retry-After')) { |
| 34 | 34 | return 1000; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - dump((float) $response->getHeaderLine('Retry-After') * 1000); |
|
| 37 | + dump((float)$response->getHeaderLine('Retry-After') * 1000); |
|
| 38 | 38 | die(); |
| 39 | 39 | |
| 40 | - return (float) $response->getHeaderLine('Retry-After') * 1000; |
|
| 40 | + return (float)$response->getHeaderLine('Retry-After') * 1000; |
|
| 41 | 41 | } |
| 42 | 42 | )); |
| 43 | 43 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | public function __construct($url, array $params = array()) |
| 13 | 13 | { |
| 14 | 14 | if (!empty($params)) { |
| 15 | - $url .= '?'.http_build_query($params); |
|
| 15 | + $url .= '?' . http_build_query($params); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | parent::__construct('GET', $url, [ |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | if (!empty($params)) { |
| 20 | - $url .= '?'.http_build_query($params); |
|
| 20 | + $url .= '?' . http_build_query($params); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | $headers = [ |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | public function __construct($url, array $params = array()) |
| 13 | 13 | { |
| 14 | 14 | if (!empty($params)) { |
| 15 | - $url .= '?'.http_build_query($params); |
|
| 15 | + $url .= '?' . http_build_query($params); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | parent::__construct('GET', $url); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | public function __construct($url, array $params = array()) |
| 13 | 13 | { |
| 14 | 14 | if (!empty($params)) { |
| 15 | - $url .= '?'.http_build_query($params); |
|
| 15 | + $url .= '?' . http_build_query($params); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | parent::__construct('DELETE', $url); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | public function checkCredentials($credentials, UserInterface $user) |
| 57 | 57 | { |
| 58 | - if (! $this->signatureVerifier->isValid($credentials['hmac'], $credentials)) { |
|
| 58 | + if (!$this->signatureVerifier->isValid($credentials['hmac'], $credentials)) { |
|
| 59 | 59 | throw new BadCredentialsException('Invalid signature'); |
| 60 | 60 | } |
| 61 | 61 | |