@@ -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); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | private function checkPattern($name, $body, $pattern) |
| 113 | 113 | { |
| 114 | - $isSuccess = (bool) preg_match($pattern, $body, $matches); |
|
| 114 | + $isSuccess = (bool)preg_match($pattern, $body, $matches); |
|
| 115 | 115 | |
| 116 | 116 | if (!$isSuccess) { |
| 117 | 117 | throw new NotMatchedException("Value '$body' in '$name' not matched in pattern. ", $this->structure); |
@@ -222,32 +222,32 @@ discard block |
||
| 222 | 222 | $nullable = isset($schemaArray['nullable']) ? (bool)$schemaArray['nullable'] : $this->schema->isAllowNullValues(); |
| 223 | 223 | |
| 224 | 224 | $validators = [ |
| 225 | - function () use ($name, $body, $type, $nullable) |
|
| 225 | + function() use ($name, $body, $type, $nullable) |
|
| 226 | 226 | { |
| 227 | 227 | return $this->matchNull($name, $body, $type, $nullable); |
| 228 | 228 | }, |
| 229 | 229 | |
| 230 | - function () use ($name, $schemaArray, $body, $type) |
|
| 230 | + function() use ($name, $schemaArray, $body, $type) |
|
| 231 | 231 | { |
| 232 | 232 | return $this->matchString($name, $schemaArray, $body, $type); |
| 233 | 233 | }, |
| 234 | 234 | |
| 235 | - function () use ($name, $body, $type) |
|
| 235 | + function() use ($name, $body, $type) |
|
| 236 | 236 | { |
| 237 | 237 | return $this->matchNumber($name, $body, $type); |
| 238 | 238 | }, |
| 239 | 239 | |
| 240 | - function () use ($name, $body, $type) |
|
| 240 | + function() use ($name, $body, $type) |
|
| 241 | 241 | { |
| 242 | 242 | return $this->matchBool($name, $body, $type); |
| 243 | 243 | }, |
| 244 | 244 | |
| 245 | - function () use ($name, $schemaArray, $body, $type) |
|
| 245 | + function() use ($name, $schemaArray, $body, $type) |
|
| 246 | 246 | { |
| 247 | 247 | return $this->matchArray($name, $schemaArray, $body, $type); |
| 248 | 248 | }, |
| 249 | 249 | |
| 250 | - function () use ($name, $schemaArray, $body, $type) |
|
| 250 | + function() use ($name, $schemaArray, $body, $type) |
|
| 251 | 251 | { |
| 252 | 252 | return $this->matchFile($name, $schemaArray, $body, $type); |
| 253 | 253 | }, |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | return true; |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | - if(!isset($schemaArray['$ref']) && isset($schemaArray['content'])) { |
|
| 359 | + if (!isset($schemaArray['$ref']) && isset($schemaArray['content'])) { |
|
| 360 | 360 | $schemaArray['$ref'] = $schemaArray['content'][key($schemaArray['content'])]['schema']['$ref']; |
| 361 | 361 | } |
| 362 | 362 | |