@@ -69,7 +69,7 @@ |
||
69 | 69 | /** |
70 | 70 | * Deserializes data into the given type. |
71 | 71 | * |
72 | - * @param mixed $data |
|
72 | + * @param string $data |
|
73 | 73 | * @param string $type |
74 | 74 | * @param string $format |
75 | 75 | * @param SerializationContext|array $context |
@@ -1,4 +1,4 @@ |
||
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 | * |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $jsonEncoderMock |
45 | 45 | ->expects($this->once()) |
46 | 46 | ->method('encode') |
47 | - ->willReturnCallback(function ($string) { |
|
47 | + ->willReturnCallback(function($string) { |
|
48 | 48 | $data = json_encode($string); |
49 | 49 | if (is_null($data)) { |
50 | 50 | throw new \Exception(); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | * @param string $username |
18 | 18 | * @param string $password |
19 | 19 | * |
20 | - * @return array |
|
20 | + * @return string |
|
21 | 21 | */ |
22 | 22 | public function loginUser($username, $password) |
23 | 23 | { |
@@ -1,4 +1,4 @@ |
||
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 | * |
@@ -50,7 +50,7 @@ |
||
50 | 50 | ->scalarNode('base_url')->defaultValue('/')->end() |
51 | 51 | ->scalarNode('host')->defaultNull()->end() |
52 | 52 | ->end() |
53 | - ->end() |
|
53 | + ->end() |
|
54 | 54 | ->end() |
55 | 55 | ->end() |
56 | 56 | ->end() |
@@ -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() |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $validator = new Validator(); |
68 | 68 | $validator->check( |
69 | 69 | $swaggerJson, |
70 | - json_decode(file_get_contents(__DIR__ . '/../../assets/swagger-schema.json')) |
|
70 | + json_decode(file_get_contents(__DIR__.'/../../assets/swagger-schema.json')) |
|
71 | 71 | ); |
72 | 72 | |
73 | 73 | if (!$validator->isValid()) { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | vfsStreamWrapper::setRoot(new vfsStreamDirectory('root')); |
84 | 84 | |
85 | 85 | file_put_contents( |
86 | - vfsStream::url('root') . '/swagger.json', |
|
86 | + vfsStream::url('root').'/swagger.json', |
|
87 | 87 | json_encode(self::$document->getDefinition()) |
88 | 88 | ); |
89 | 89 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | json_encode(self::$document->getDefinition(), JSON_PRETTY_PRINT) |
93 | 93 | ); |
94 | 94 | |
95 | - self::$schemaManager = new SchemaManager(vfsStream::url('root') . '/swagger.json'); |
|
95 | + self::$schemaManager = new SchemaManager(vfsStream::url('root').'/swagger.json'); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | { |
224 | 224 | $uri = $path; |
225 | 225 | if (count($params)) { |
226 | - $uri = $path . '?' . http_build_query($params); |
|
226 | + $uri = $path.'?'.http_build_query($params); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | return $uri; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | $this->assertSame( |
258 | 258 | JSON_ERROR_NONE, |
259 | 259 | json_last_error(), |
260 | - "Not valid JSON: " . $jsonErrorMessage . "(" . var_export($json, true) . ")" |
|
260 | + "Not valid JSON: ".$jsonErrorMessage."(".var_export($json, true).")" |
|
261 | 261 | ); |
262 | 262 | } |
263 | 263 |
@@ -157,7 +157,7 @@ |
||
157 | 157 | ); |
158 | 158 | if (!$target) { |
159 | 159 | throw new InvalidReferenceException( |
160 | - "Target '$path' does not exist'" . ($uri ? " at '$uri''" : '') |
|
160 | + "Target '$path' does not exist'".($uri ? " at '$uri''" : '') |
|
161 | 161 | ); |
162 | 162 | } |
163 | 163 |
@@ -25,6 +25,6 @@ |
||
25 | 25 | */ |
26 | 26 | public function registerContainerConfiguration(LoaderInterface $loader) |
27 | 27 | { |
28 | - $loader->load(__DIR__ . '/config_' . $this->getEnvironment() . '.yml'); |
|
28 | + $loader->load(__DIR__.'/config_'.$this->getEnvironment().'.yml'); |
|
29 | 29 | } |
30 | 30 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | ->willReturn([]); |
77 | 77 | |
78 | 78 | $this->loader->load(self::DOCUMENT_PATH); |
79 | - $this->loader->load(self::DOCUMENT_PATH . '2'); |
|
79 | + $this->loader->load(self::DOCUMENT_PATH.'2'); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ->willReturn($pathDefinitions); |
97 | 97 | |
98 | 98 | $routes1 = $this->loader->load(self::DOCUMENT_PATH); |
99 | - $routes2 = $this->loader->load(self::DOCUMENT_PATH . '2'); |
|
99 | + $routes2 = $this->loader->load(self::DOCUMENT_PATH.'2'); |
|
100 | 100 | $this->assertSame(count($routes1), count(array_diff_key($routes1->all(), $routes2->all()))); |
101 | 101 | } |
102 | 102 | |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | |
349 | 349 | $definitionPaths = array_keys((array)$pathDefinitions); |
350 | 350 | sort($definitionPaths); |
351 | - $routePaths = array_map(function ($route) { |
|
351 | + $routePaths = array_map(function($route) { |
|
352 | 352 | return $route->getPath(); |
353 | 353 | }, $routes->getIterator()->getArrayCopy()); |
354 | 354 | sort($routePaths); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
43 | 43 | * |
44 | - * @param mixed $resource |
|
44 | + * @param string $resource |
|
45 | 45 | * @param string $type |
46 | 46 | * |
47 | 47 | * @return bool |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | /** |
55 | 55 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) |
56 | 56 | * |
57 | - * @param mixed $resource |
|
57 | + * @param string $resource |
|
58 | 58 | * @param null $type |
59 | 59 | * |
60 | 60 | * @return RouteCollection |
@@ -9,7 +9,6 @@ |
||
9 | 9 | namespace KleijnWeb\SwaggerBundle\Routing; |
10 | 10 | |
11 | 11 | use KleijnWeb\SwaggerBundle\Document\DocumentRepository; |
12 | -use KleijnWeb\SwaggerBundle\Document\OperationObject; |
|
13 | 12 | use KleijnWeb\SwaggerBundle\Document\SwaggerDocument; |
14 | 13 | use Symfony\Component\Config\Loader\Loader; |
15 | 14 | use Symfony\Component\Routing\Route; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $router, |
99 | 99 | $routerController |
100 | 100 | ); |
101 | - $defaults = [ |
|
101 | + $defaults = [ |
|
102 | 102 | '_controller' => $controllerKey, |
103 | 103 | '_definition' => $resource, |
104 | 104 | '_swagger_path' => $path |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | break; |
141 | 141 | } |
142 | 142 | if (isset($paramDefinition->enum)) { |
143 | - $requirements[$paramDefinition->name] = '(' . |
|
143 | + $requirements[$paramDefinition->name] = '('. |
|
144 | 144 | implode('|', $paramDefinition->enum) |
145 | 145 | . ')'; |
146 | 146 | break; |