@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | public static function setUpBeforeClass() |
30 | 30 | { |
31 | - static::initSchemaManager(__DIR__ . '/PetStore/app/swagger/petstore.yml'); |
|
31 | + static::initSchemaManager(__DIR__.'/PetStore/app/swagger/petstore.yml'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -10,7 +10,6 @@ |
||
10 | 10 | |
11 | 11 | use KleijnWeb\SwaggerBundle\Response\Error\HttpError; |
12 | 12 | use KleijnWeb\SwaggerBundle\Response\Error\LogRefBuilder; |
13 | -use KleijnWeb\SwaggerBundle\Response\ErrorResponseFactory; |
|
14 | 13 | use Psr\Log\LogLevel; |
15 | 14 | use Symfony\Component\HttpFoundation\Request; |
16 | 15 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | public static function setUpBeforeClass() |
30 | 30 | { |
31 | - static::initSchemaManager(__DIR__ . '/PetStore/app/swagger/petstore.yml'); |
|
31 | + static::initSchemaManager(__DIR__.'/PetStore/app/swagger/petstore.yml'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function serialize($data, Specification $specification): string |
45 | 45 | { |
46 | - $export = function ($item, \stdClass $schema) use (&$export) { |
|
46 | + $export = function($item, \stdClass $schema) use (&$export) { |
|
47 | 47 | if ($item instanceof \DateTimeInterface) { |
48 | 48 | if ($schema->format == 'date') { |
49 | 49 | return $item->format('Y-m-d'); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | switch ($schema->type) { |
57 | 57 | case 'array': |
58 | - return array_map(function ($value) use (&$export, $schema) { |
|
58 | + return array_map(function($value) use (&$export, $schema) { |
|
59 | 59 | return $export($value, $schema->items); |
60 | 60 | }, $item); |
61 | 61 | case 'object': |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $data = (array)$item; |
64 | 64 | $offset = strlen($class) + 2; |
65 | 65 | |
66 | - $array = array_filter(array_combine(array_map(function ($k) use ($offset) { |
|
66 | + $array = array_filter(array_combine(array_map(function($k) use ($offset) { |
|
67 | 67 | return substr($k, $offset); |
68 | 68 | }, array_keys($data)), array_values($data))); |
69 | 69 | |
@@ -101,10 +101,10 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function deserialize($data, string $type, Specification $specification) |
103 | 103 | { |
104 | - $import = function ($item, \stdClass $schema) use (&$import) { |
|
104 | + $import = function($item, \stdClass $schema) use (&$import) { |
|
105 | 105 | switch ($schema->type) { |
106 | 106 | case 'array': |
107 | - return array_map(function ($value) use (&$import, $schema) { |
|
107 | + return array_map(function($value) use (&$import, $schema) { |
|
108 | 108 | return $import($value, $schema->items); |
109 | 109 | }, $item); |
110 | 110 | case 'object': |
@@ -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 |