@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | |
16 | 16 | abstract class Body |
17 | 17 | { |
18 | - const SWAGGER_PROPERTIES="properties"; |
|
19 | - const SWAGGER_ADDITIONAL_PROPERTIES="additionalProperties"; |
|
20 | - const SWAGGER_REQUIRED="required"; |
|
18 | + const SWAGGER_PROPERTIES = "properties"; |
|
19 | + const SWAGGER_ADDITIONAL_PROPERTIES = "additionalProperties"; |
|
20 | + const SWAGGER_REQUIRED = "required"; |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * @var Schema |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | return new OpenApiResponseBody($schema, $name, $structure, $allowNullValues); |
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); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | private function checkPattern($name, $body, $pattern) |
113 | 113 | { |
114 | 114 | $pattern = $this->preparePattern($pattern); |
115 | - $isSuccess = (bool) preg_match($pattern, $body, $matches); |
|
115 | + $isSuccess = (bool)preg_match($pattern, $body, $matches); |
|
116 | 116 | |
117 | 117 | if (!$isSuccess) { |
118 | 118 | throw new NotMatchedException("Value '$body' in '$name' not matched in pattern. ", $this->structure); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | private function preparePattern($pattern) |
123 | 123 | { |
124 | 124 | if ($pattern[0] !== '/' && substr($pattern, -1) !== '/') { |
125 | - $pattern = '/' . $pattern . '/'; |
|
125 | + $pattern = '/'.$pattern.'/'; |
|
126 | 126 | } |
127 | 127 | return $pattern; |
128 | 128 | } |
@@ -231,32 +231,32 @@ discard block |
||
231 | 231 | $nullable = isset($schemaArray['nullable']) ? (bool)$schemaArray['nullable'] : $this->schema->isAllowNullValues(); |
232 | 232 | |
233 | 233 | $validators = [ |
234 | - function () use ($name, $body, $type, $nullable) |
|
234 | + function() use ($name, $body, $type, $nullable) |
|
235 | 235 | { |
236 | 236 | return $this->matchNull($name, $body, $type, $nullable); |
237 | 237 | }, |
238 | 238 | |
239 | - function () use ($name, $schemaArray, $body, $type) |
|
239 | + function() use ($name, $schemaArray, $body, $type) |
|
240 | 240 | { |
241 | 241 | return $this->matchString($name, $schemaArray, $body, $type); |
242 | 242 | }, |
243 | 243 | |
244 | - function () use ($name, $body, $type) |
|
244 | + function() use ($name, $body, $type) |
|
245 | 245 | { |
246 | 246 | return $this->matchNumber($name, $body, $type); |
247 | 247 | }, |
248 | 248 | |
249 | - function () use ($name, $body, $type) |
|
249 | + function() use ($name, $body, $type) |
|
250 | 250 | { |
251 | 251 | return $this->matchBool($name, $body, $type); |
252 | 252 | }, |
253 | 253 | |
254 | - function () use ($name, $schemaArray, $body, $type) |
|
254 | + function() use ($name, $schemaArray, $body, $type) |
|
255 | 255 | { |
256 | 256 | return $this->matchArray($name, $schemaArray, $body, $type); |
257 | 257 | }, |
258 | 258 | |
259 | - function () use ($name, $schemaArray, $body, $type) |
|
259 | + function() use ($name, $schemaArray, $body, $type) |
|
260 | 260 | { |
261 | 261 | return $this->matchFile($name, $schemaArray, $body, $type); |
262 | 262 | }, |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | return true; |
366 | 366 | } |
367 | 367 | |
368 | - if(!isset($schemaArray['$ref']) && isset($schemaArray['content'])) { |
|
368 | + if (!isset($schemaArray['$ref']) && isset($schemaArray['content'])) { |
|
369 | 369 | $schemaArray['$ref'] = $schemaArray['content'][key($schemaArray['content'])]['schema']['$ref']; |
370 | 370 | } |
371 | 371 |