Completed
Push — master ( e7cc7b...f2288e )
by Daniel
02:58
created
src/Api/Response/JsonResponse.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/Api/Endpoint/AbstractEndpoint.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Api/Endpoint/PageEndpoint.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Api/HttpClientFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Api/Request/GetJson.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
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, [
Please login to merge, or discard this patch.
src/Api/Request/PutJson.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
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 = [
Please login to merge, or discard this patch.
src/Api/Request/GetParams.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Api/Request/DeleteParams.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Api/Request/PostJson.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
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 = [
Please login to merge, or discard this patch.