Completed
Pull Request — master (#36)
by Joao
02:10
created
src/SwaggerRequester.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -170,11 +170,11 @@
 block discarded – undo
170 170
         try {
171 171
             $response = $this->guzzleHttpClient->send($request, ['allow_redirects' => false]);
172 172
             $responseHeader = $response->getHeaders();
173
-            $responseBody = json_decode((string) $response->getBody(), true);
173
+            $responseBody = json_decode((string)$response->getBody(), true);
174 174
             $statusReturned = $response->getStatusCode();
175 175
         } catch (BadResponseException $ex) {
176 176
             $responseHeader = $ex->getResponse()->getHeaders();
177
-            $responseBody = json_decode((string) $ex->getResponse()->getBody(), true);
177
+            $responseBody = json_decode((string)$ex->getResponse()->getBody(), true);
178 178
             $statusReturned = $ex->getResponse()->getStatusCode();
179 179
         }
180 180
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -119,6 +119,9 @@
 block discarded – undo
119 119
         return $this;
120 120
     }
121 121
 
122
+    /**
123
+     * @param integer $code
124
+     */
122 125
     public function assertResponseCode($code)
123 126
     {
124 127
         $this->statusExpected = $code;
Please login to merge, or discard this patch.
src/SwaggerBody.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
 
10 10
 abstract class SwaggerBody
11 11
 {
12
-    const SWAGGER_PROPERTIES="properties";
13
-    const SWAGGER_REQUIRED="required";
12
+    const SWAGGER_PROPERTIES = "properties";
13
+    const SWAGGER_REQUIRED = "required";
14 14
 
15 15
     /**
16 16
      * @var SwaggerSchema
@@ -147,27 +147,27 @@  discard block
 block discarded – undo
147 147
         $type = $schema['type'];
148 148
 
149 149
         $validators = [
150
-            function () use ($name, $body, $type)
150
+            function() use ($name, $body, $type)
151 151
             {
152 152
                 return $this->matchNull($name, $body, $type);
153 153
             },
154 154
 
155
-            function () use ($name, $schema, $body, $type)
155
+            function() use ($name, $schema, $body, $type)
156 156
             {
157 157
                 return $this->matchString($name, $schema, $body, $type);
158 158
             },
159 159
 
160
-            function () use ($name, $body, $type)
160
+            function() use ($name, $body, $type)
161 161
             {
162 162
                 return $this->matchNumber($name, $body, $type);
163 163
             },
164 164
 
165
-            function () use ($name, $body, $type)
165
+            function() use ($name, $body, $type)
166 166
             {
167 167
                 return $this->matchBool($name, $body, $type);
168 168
             },
169 169
 
170
-            function () use ($name, $schema, $body, $type)
170
+            function() use ($name, $schema, $body, $type)
171 171
             {
172 172
                 return $this->matchArray($name, $schema, $body, $type);
173 173
             }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
             return true;
268 268
         }
269 269
 
270
-        if(!isset($schema['$ref']) && isset($schema['content'])) {
270
+        if (!isset($schema['$ref']) && isset($schema['content'])) {
271 271
             $schema['$ref'] = $schema['content'][key($schema['content'])]['schema']['$ref'];
272 272
         }
273 273
 
Please login to merge, or discard this patch.
src/SwaggerSchema.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     public function __construct($jsonFile, $allowNullValues = false)
25 25
     {
26 26
         $this->jsonFile = json_decode($jsonFile, true);
27
-        $this->allowNullValues = (bool) $allowNullValues;
27
+        $this->allowNullValues = (bool)$allowNullValues;
28 28
         $this->specificationVersion = isset($this->jsonFile['swagger']) ? '2' : '3';
29 29
     }
30 30
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
     {
232 232
         $structure = $this->getPathDefinition($path, $method);
233 233
 
234
-        if($this->getSpecificationVersion() === '3') {
234
+        if ($this->getSpecificationVersion() === '3') {
235 235
             if (!isset($structure['requestBody'])) {
236 236
                 return new SwaggerRequestBody($this, "$method $path", []);
237 237
             }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
      */
286 286
     public function setAllowNullValues($value)
287 287
     {
288
-        $this->allowNullValues = (bool) $value;
288
+        $this->allowNullValues = (bool)$value;
289 289
     }
290 290
 
291 291
     public function setServerVariable($var, $value)
Please login to merge, or discard this patch.