Passed
Pull Request — master (#56)
by
unknown
02:23
created
src/AbstractRequester.php 2 patches
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.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         // Preparing Parameters
164 164
         $paramInQuery = null;
165 165
         if (!empty($this->query)) {
166
-            $paramInQuery = '?' . http_build_query($this->query);
166
+            $paramInQuery = '?'.http_build_query($this->query);
167 167
         }
168 168
 
169 169
         // Preparing Header
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
 
188 188
         $statusReturned = null;
189 189
         // Run the request
190
-        $response = $this->handleRequest($pathName . $paramInQuery, $header);
190
+        $response = $this->handleRequest($pathName.$paramInQuery, $header);
191 191
 
192 192
         // Get the response
193 193
         $responseHeader = $response->getHeaders();
194
-        $responseBody = json_decode((string) $response->getBody(), true);
194
+        $responseBody = json_decode((string)$response->getBody(), true);
195 195
         $statusReturned = $response->getStatusCode();
196 196
 
197 197
         // Assert results
Please login to merge, or discard this patch.
src/ApiTestCase.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,5 +8,5 @@
 block discarded – undo
8 8
 
9 9
 abstract class ApiTestCase extends TestCase
10 10
 {
11
-   use AssertRequestAgainstSchema;
11
+    use AssertRequestAgainstSchema;
12 12
 }
Please login to merge, or discard this patch.
src/ApiRequester.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         // Make the request
37 37
         $request = new Request(
38 38
             $this->method,
39
-            $this->schema->getServerUrl() . $path,
39
+            $this->schema->getServerUrl().$path,
40 40
             $headers,
41 41
             json_encode($this->requestBody)
42 42
         );
Please login to merge, or discard this patch.
src/Base/StringFormatValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     public function validate($format, $value)
22 22
     {
23 23
         // full-date notation as defined by RFC 3339, section 5.6, for example, 2017-07-21
24
-        if ($format === 'date' ) {
24
+        if ($format === 'date') {
25 25
             $match = preg_match('/^[\d]{4}-[\d]{2}-[\d]{2}$/', $value);
26 26
             return $match !== false && $match !== 0;
27 27
         }
Please login to merge, or discard this patch.
src/Base/Body.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 
16 16
 abstract class Body
17 17
 {
18
-    const SWAGGER_PROPERTIES="properties";
19
-    const SWAGGER_REQUIRED="required";
18
+    const SWAGGER_PROPERTIES = "properties";
19
+    const SWAGGER_REQUIRED = "required";
20 20
 
21 21
     /**
22 22
      * @var Schema
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             return new OpenApiResponseBody($schema, $name, $structure, $allowNullValues, $validator);
80 80
         }
81 81
 
82
-        throw new GenericSwaggerException("Cannot get instance SwaggerBody or SchemaBody from " . get_class($schema));
82
+        throw new GenericSwaggerException("Cannot get instance SwaggerBody or SchemaBody from ".get_class($schema));
83 83
     }
84 84
 
85 85
     abstract public function match($body);
@@ -194,27 +194,27 @@  discard block
 block discarded – undo
194 194
         $nullable = isset($schema['nullable']) ? (bool)$schema['nullable'] : $this->schema->isAllowNullValues();
195 195
 
196 196
         $validators = [
197
-            function () use ($name, $body, $type, $nullable)
197
+            function() use ($name, $body, $type, $nullable)
198 198
             {
199 199
                 return $this->matchNull($name, $body, $type, $nullable);
200 200
             },
201 201
 
202
-            function () use ($name, $schema, $body, $type)
202
+            function() use ($name, $schema, $body, $type)
203 203
             {
204 204
                 return $this->matchString($name, $schema, $body, $type);
205 205
             },
206 206
 
207
-            function () use ($name, $body, $type)
207
+            function() use ($name, $body, $type)
208 208
             {
209 209
                 return $this->matchNumber($name, $body, $type);
210 210
             },
211 211
 
212
-            function () use ($name, $body, $type)
212
+            function() use ($name, $body, $type)
213 213
             {
214 214
                 return $this->matchBool($name, $body, $type);
215 215
             },
216 216
 
217
-            function () use ($name, $schema, $body, $type)
217
+            function() use ($name, $schema, $body, $type)
218 218
             {
219 219
                 return $this->matchArray($name, $schema, $body, $type);
220 220
             },
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
             return true;
315 315
         }
316 316
 
317
-        if(!isset($schema['$ref']) && isset($schema['content'])) {
317
+        if (!isset($schema['$ref']) && isset($schema['content'])) {
318 318
             $schema['$ref'] = $schema['content'][key($schema['content'])]['schema']['$ref'];
319 319
         }
320 320
 
Please login to merge, or discard this patch.