@@ -9,7 +9,6 @@ |
||
| 9 | 9 | namespace KleijnWeb\SwaggerBundle\Request; |
| 10 | 10 | |
| 11 | 11 | use KleijnWeb\SwaggerBundle\Document\DocumentRepository; |
| 12 | -use KleijnWeb\SwaggerBundle\Document\Specification\Operation; |
|
| 13 | 12 | use KleijnWeb\SwaggerBundle\Exception\MalformedContentException; |
| 14 | 13 | use KleijnWeb\SwaggerBundle\Exception\UnsupportedContentTypeException; |
| 15 | 14 | use KleijnWeb\SwaggerBundle\Serialize\Serializer; |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | namespace KleijnWeb\SwaggerBundle\Response; |
| 10 | 10 | |
| 11 | 11 | use KleijnWeb\SwaggerBundle\Document\DocumentRepository; |
| 12 | -use KleijnWeb\SwaggerBundle\Document\Specification; |
|
| 13 | 12 | use KleijnWeb\SwaggerBundle\Request\RequestMeta; |
| 14 | 13 | use KleijnWeb\SwaggerBundle\Serialize\Serializer; |
| 15 | 14 | use Symfony\Component\HttpFoundation\Request; |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace KleijnWeb\SwaggerBundle\Tests\Serialize\Serializer; |
| 10 | 10 | |
| 11 | -use KleijnWeb\SwaggerBundle\Document\Specification; |
|
| 12 | 11 | use KleijnWeb\SwaggerBundle\Serialize\Serializer\ObjectSerializer; |
| 13 | 12 | use KleijnWeb\SwaggerBundle\Serialize\TypeResolver\SerializerTypeDefinitionMap; |
| 14 | 13 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | public function canApplyRecursiveCallback() |
| 23 | 23 | { |
| 24 | 24 | $keys = []; |
| 25 | - self::getPetStoreDocument()->apply(function ($value, $key) use (&$keys) { |
|
| 25 | + self::getPetStoreDocument()->apply(function($value, $key) use (&$keys) { |
|
| 26 | 26 | $keys[] = $key; |
| 27 | 27 | }); |
| 28 | 28 | |
@@ -36,13 +36,13 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $spec = self::getPetStoreDocument(); |
| 38 | 38 | |
| 39 | - $spec->apply(function (&$value) { |
|
| 39 | + $spec->apply(function(&$value) { |
|
| 40 | 40 | if (is_scalar($value)) { |
| 41 | 41 | $value = __CLASS__; |
| 42 | 42 | } |
| 43 | 43 | }); |
| 44 | 44 | |
| 45 | - $spec->apply(function ($value) use (&$values) { |
|
| 45 | + $spec->apply(function($value) use (&$values) { |
|
| 46 | 46 | if (is_scalar($value)) { |
| 47 | 47 | $values[] = $value; |
| 48 | 48 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $spec = self::getPetStoreDocument(); |
| 60 | 60 | |
| 61 | - $spec->apply(function ($value, $key) use (&$keys) { |
|
| 61 | + $spec->apply(function($value, $key) use (&$keys) { |
|
| 62 | 62 | |
| 63 | 63 | if ($key === 'paths') { |
| 64 | 64 | |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | $exception = $error->getException(); |
| 35 | 35 | |
| 36 | - if($exception instanceof InvalidParametersException){ |
|
| 36 | + if ($exception instanceof InvalidParametersException) { |
|
| 37 | 37 | $data['errors'] = $exception->getValidationErrors(); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $typeNames = []; |
| 45 | 45 | $definitions = []; |
| 46 | 46 | |
| 47 | - $add = function ($schema, $key, $typeName, $operationId = null) use (&$typeNames, &$definitions) { |
|
| 47 | + $add = function($schema, $key, $typeName, $operationId = null) use (&$typeNames, &$definitions) { |
|
| 48 | 48 | if (!isset($schema->{'x-class'})) { |
| 49 | 49 | $schema->{'x-class'} = $this->classNameResolver->resolve($typeName); |
| 50 | 50 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | }; |
| 57 | 57 | |
| 58 | - $specification->apply(function (&$schema) use ($add) { |
|
| 58 | + $specification->apply(function(&$schema) use ($add) { |
|
| 59 | 59 | if ($schema instanceof \stdClass) { |
| 60 | 60 | if ($this->typeNameResolver->isResolvableSchema($schema)) { |
| 61 | 61 | $typeName = $key = $this->typeNameResolver->resolveUsingSchema($schema); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | }); |
| 66 | 66 | |
| 67 | 67 | $operations = $specification->getOperations(); |
| 68 | - array_walk($operations, function (Operation $operation) use ($add) { |
|
| 68 | + array_walk($operations, function(Operation $operation) use ($add) { |
|
| 69 | 69 | if ($operation->hasParameters()) { |
| 70 | 70 | foreach ($operation->getParameters() as $parameterDefinition) { |
| 71 | 71 | if ($parameterDefinition->in == 'body' && isset($parameterDefinition->schema)) { |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | return ''; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - $getTypeFromReference = function ($schema) { |
|
| 52 | + $getTypeFromReference = function($schema) { |
|
| 53 | 53 | return $schema->{'x-type'} = substr($schema->{'x-ref-id'}, strrpos($schema->{'x-ref-id'}, '/') + 1); |
| 54 | 54 | }; |
| 55 | 55 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $suffix = "[]"; |
| 49 | 49 | } |
| 50 | 50 | if (class_exists($fqcn = $this->qualify($resourceNamespace, $typeName))) { |
| 51 | - return $fqcn . $suffix; |
|
| 51 | + return $fqcn.$suffix; |
|
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
@@ -63,6 +63,6 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | protected function qualify(string $resourceNamespace, string $typeName): string |
| 65 | 65 | { |
| 66 | - return ltrim($resourceNamespace . '\\' . $typeName, '\\'); |
|
| 66 | + return ltrim($resourceNamespace.'\\'.$typeName, '\\'); |
|
| 67 | 67 | } |
| 68 | 68 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | public function apply(callable $f) |
| 42 | 42 | { |
| 43 | - $recurse = function (&$item) use ($f, &$recurse) { |
|
| 43 | + $recurse = function(&$item) use ($f, &$recurse) { |
|
| 44 | 44 | |
| 45 | 45 | foreach ($item as $attribute => &$value) { |
| 46 | 46 | if (false === $f($value, $attribute)) { |