Test Setup Failed
Pull Request — master (#30)
by Harry
01:24
created
src/functions_include.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
  * @link http://github.com/graze/guzzle-jsonrpc
13 13
  */
14 14
 
15
-if (! function_exists('Graze\GuzzleHttp\JsonRpc\json_encode')) {
15
+if ( ! function_exists('Graze\GuzzleHttp\JsonRpc\json_encode')) {
16 16
     require __DIR__ . '/functions.php';
17 17
 }
Please login to merge, or discard this patch.
src/Client.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     public function sendAsync(RequestInterface $request)
116 116
     {
117 117
         return $this->httpClient->sendAsync($request)->then(
118
-            function (ResponseInterface $response) use ($request) {
118
+            function(ResponseInterface $response) use ($request) {
119 119
                 return $request->getRpcId() ? $response : null;
120 120
             }
121 121
         );
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         return $this->httpClient->sendAsync($this->createRequest(
140 140
             RequestInterface::BATCH,
141 141
             $this->getBatchRequestOptions($requests)
142
-        ))->then(function (ResponseInterface $response) {
142
+        ))->then(function(ResponseInterface $response) {
143 143
             return $this->getBatchResponses($response);
144 144
         });
145 145
     }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      */
167 167
     protected function getBatchRequestOptions(array $requests)
168 168
     {
169
-        return array_map(function (RequestInterface $request) {
169
+        return array_map(function(RequestInterface $request) {
170 170
             return JsonRpc\json_decode((string) $request->getBody());
171 171
         }, $requests);
172 172
     }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
     {
181 181
         $results = JsonRpc\json_decode((string) $response->getBody(), true);
182 182
 
183
-        return array_map(function (array $result) use ($response) {
183
+        return array_map(function(array $result) use ($response) {
184 184
             return $this->messageFactory->createResponse(
185 185
                 $response->getStatusCode(),
186 186
                 $response->getHeaders(),
Please login to merge, or discard this patch.
src/functions.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,10 +72,10 @@
 block discarded – undo
72 72
 function json_encode($data, $escapeChars = true)
73 73
 {
74 74
     $options =
75
-        JSON_HEX_AMP  |
75
+        JSON_HEX_AMP |
76 76
         JSON_HEX_APOS |
77 77
         JSON_HEX_QUOT |
78
-        JSON_HEX_TAG  |
78
+        JSON_HEX_TAG |
79 79
         JSON_UNESCAPED_UNICODE |
80 80
         JSON_UNESCAPED_SLASHES;
81 81
 
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,11 +38,11 @@
 block discarded – undo
38 38
 function json_decode($json, $assoc = false, $depth = 512, $options = 0)
39 39
 {
40 40
     static $jsonErrors = [
41
-         JSON_ERROR_DEPTH => 'JSON_ERROR_DEPTH - Maximum stack depth exceeded',
42
-         JSON_ERROR_STATE_MISMATCH => 'JSON_ERROR_STATE_MISMATCH - Underflow or the modes mismatch',
43
-         JSON_ERROR_CTRL_CHAR => 'JSON_ERROR_CTRL_CHAR - Unexpected control character found',
44
-         JSON_ERROR_SYNTAX => 'JSON_ERROR_SYNTAX - Syntax error, malformed JSON',
45
-         JSON_ERROR_UTF8 => 'JSON_ERROR_UTF8 - Malformed UTF-8 characters, possibly incorrectly encoded',
41
+            JSON_ERROR_DEPTH => 'JSON_ERROR_DEPTH - Maximum stack depth exceeded',
42
+            JSON_ERROR_STATE_MISMATCH => 'JSON_ERROR_STATE_MISMATCH - Underflow or the modes mismatch',
43
+            JSON_ERROR_CTRL_CHAR => 'JSON_ERROR_CTRL_CHAR - Unexpected control character found',
44
+            JSON_ERROR_SYNTAX => 'JSON_ERROR_SYNTAX - Syntax error, malformed JSON',
45
+            JSON_ERROR_UTF8 => 'JSON_ERROR_UTF8 - Malformed UTF-8 characters, possibly incorrectly encoded',
46 46
     ];
47 47
 
48 48
     // Patched support for decoding empty strings for PHP 7+
Please login to merge, or discard this patch.
src/Middleware/AbstractMiddleware.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
      */
27 27
     public function __invoke(callable $fn)
28 28
     {
29
-        return function (HttpRequestInterface $request, array $options) use ($fn) {
29
+        return function(HttpRequestInterface $request, array $options) use ($fn) {
30 30
             return $fn(call_user_func([$this, 'applyRequest'], $request, $options), $options)->then(
31
-                function (HttpResponseInterface $response) use ($request, $options) {
31
+                function(HttpResponseInterface $response) use ($request, $options) {
32 32
                     return call_user_func([$this, 'applyResponse'], $request, $response, $options);
33 33
                 }
34 34
             );
Please login to merge, or discard this patch.