@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /* |
| 3 | 3 | * This file is part of the KleijnWeb\SwaggerBundle package. |
| 4 | 4 | * |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | ->arrayNode('namespace') |
| 38 | 38 | ->beforeNormalization() |
| 39 | 39 | ->ifString() |
| 40 | - ->then(function ($v) { |
|
| 40 | + ->then(function($v) { |
|
| 41 | 41 | return [$v]; |
| 42 | 42 | }) |
| 43 | 43 | ->end() |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function load(array $configs, ContainerBuilder $container) |
| 26 | 26 | { |
| 27 | 27 | $config = $this->processConfiguration(new Configuration(), $configs); |
| 28 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 28 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 29 | 29 | $loader->load('services.yml'); |
| 30 | 30 | |
| 31 | 31 | $container->setParameter('swagger.document.base_path', $config['document']['base_path']); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | ->willReturn((object)[]); |
| 81 | 81 | |
| 82 | 82 | $this->loader->load(self::DOCUMENT_PATH); |
| 83 | - $this->loader->load(self::DOCUMENT_PATH . '2'); |
|
| 83 | + $this->loader->load(self::DOCUMENT_PATH.'2'); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | ->willReturn($pathDefinitions); |
| 101 | 101 | |
| 102 | 102 | $routes1 = $this->loader->load(self::DOCUMENT_PATH); |
| 103 | - $routes2 = $this->loader->load(self::DOCUMENT_PATH . '2'); |
|
| 103 | + $routes2 = $this->loader->load(self::DOCUMENT_PATH.'2'); |
|
| 104 | 104 | $this->assertSame(count($routes1), count(array_diff_key($routes1->all(), $routes2->all()))); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | $definitionPaths = array_keys((array)$pathDefinitions); |
| 355 | 355 | sort($definitionPaths); |
| 356 | 356 | |
| 357 | - $routePaths = array_map(function (Route $route) { |
|
| 357 | + $routePaths = array_map(function(Route $route) { |
|
| 358 | 358 | return $route->getPath(); |
| 359 | 359 | }, $routes->getIterator()->getArrayCopy()); |
| 360 | 360 | |
@@ -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 | |
@@ -50,13 +50,13 @@ |
||
| 50 | 50 | |
| 51 | 51 | $mock->expects($this->any()) |
| 52 | 52 | ->method('serialize') |
| 53 | - ->willReturnCallback(function (array $value) { |
|
| 53 | + ->willReturnCallback(function(array $value) { |
|
| 54 | 54 | return json_encode($value); |
| 55 | 55 | }); |
| 56 | 56 | |
| 57 | 57 | $mock->expects($this->any()) |
| 58 | 58 | ->method('deserialize') |
| 59 | - ->willReturnCallback(function (string $value) { |
|
| 59 | + ->willReturnCallback(function(string $value) { |
|
| 60 | 60 | $array = json_decode($value, true); |
| 61 | 61 | |
| 62 | 62 | if (!is_array($array)) { |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $this->typeResolverMock |
| 41 | 41 | ->expects($this->any()) |
| 42 | 42 | ->method('resolveUsingSchema') |
| 43 | - ->willReturnCallback(function (\stdClass $schema) { |
|
| 43 | + ->willReturnCallback(function(\stdClass $schema) { |
|
| 44 | 44 | return "KleijnWeb\\SwaggerBundle\\Tests\\Serialize\\Serializer\\Stubs\\$schema->class"; |
| 45 | 45 | }); |
| 46 | 46 | |
@@ -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': |