@@ -20,8 +20,8 @@ |
||
20 | 20 | |
21 | 21 | public function writeHeader(HttpResponse $response) |
22 | 22 | { |
23 | - echo "HTTP/1.1 " . $response->getResponseCode() . "\r\n"; |
|
24 | - echo "Content-Type: " . $this->getContentType() . "\r\n"; |
|
23 | + echo "HTTP/1.1 ".$response->getResponseCode()."\r\n"; |
|
24 | + echo "Content-Type: ".$this->getContentType()."\r\n"; |
|
25 | 25 | |
26 | 26 | foreach ($response->getHeaders() as $header => $value) { |
27 | 27 | if (is_array($value)) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function withOutputProcessorForRoute($method, $path, $processor) |
68 | 68 | { |
69 | - $this->overrideOutputProcessor[strtoupper($method) . " " . $path] = $processor; |
|
69 | + $this->overrideOutputProcessor[strtoupper($method)." ".$path] = $processor; |
|
70 | 70 | return $this; |
71 | 71 | } |
72 | 72 | |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | ); |
131 | 131 | } |
132 | 132 | |
133 | - $outputProcessor = $this->getMethodOutputProcessor($method, $basePath. $path, $properties); |
|
133 | + $outputProcessor = $this->getMethodOutputProcessor($method, $basePath.$path, $properties); |
|
134 | 134 | |
135 | 135 | $routes[] = new Route( |
136 | 136 | strtoupper($method), |
137 | - $basePath . $path, |
|
137 | + $basePath.$path, |
|
138 | 138 | $outputProcessor, |
139 | 139 | $parts[0], |
140 | 140 | $parts[1] |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | protected function sortPaths($pathList) |
149 | 149 | { |
150 | - usort($pathList, function ($left, $right) { |
|
150 | + usort($pathList, function($left, $right) { |
|
151 | 151 | if (strpos($left, '{') === false && strpos($right, '{') !== false) { |
152 | 152 | return -16384; |
153 | 153 | } |
@@ -175,14 +175,14 @@ discard block |
||
175 | 175 | */ |
176 | 176 | protected function getMethodOutputProcessor($method, $path, $properties) |
177 | 177 | { |
178 | - $key = strtoupper($method) . " " . $path; |
|
178 | + $key = strtoupper($method)." ".$path; |
|
179 | 179 | if (isset($this->overrideOutputProcessor[$key])) { |
180 | 180 | return $this->overrideOutputProcessor[$key]; |
181 | 181 | } |
182 | 182 | |
183 | 183 | $produces = null; |
184 | 184 | if (isset($properties['produces'])) { |
185 | - $produces = (array) $properties['produces']; |
|
185 | + $produces = (array)$properties['produces']; |
|
186 | 186 | } |
187 | 187 | if (empty($produces) && isset($properties["responses"]["200"]["content"])) { |
188 | 188 | $produces = array_keys($properties["responses"]["200"]["content"]); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | public function getDispatcher() |
48 | 48 | { |
49 | 49 | // Generic Dispatcher for RestServer |
50 | - return simpleDispatcher(function (RouteCollector $r) { |
|
50 | + return simpleDispatcher(function(RouteCollector $r) { |
|
51 | 51 | |
52 | 52 | foreach ($this->getRoutes() as $route) { |
53 | 53 | $r->addRoute( |