@@ -49,9 +49,9 @@ |
||
| 49 | 49 | * |
| 50 | 50 | ********************************************************* */ |
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * @return int|null A handler may return nothing, or a Handler::HANDLE_* constant |
|
| 54 | - */ |
|
| 52 | + /** |
|
| 53 | + * @return int|null A handler may return nothing, or a Handler::HANDLE_* constant |
|
| 54 | + */ |
|
| 55 | 55 | public function handle() |
| 56 | 56 | { |
| 57 | 57 | $r = new ReflectionMethod($this->effectiveHandler, 'getException'); |
@@ -17,8 +17,8 @@ |
||
| 17 | 17 | |
| 18 | 18 | if ($replace) { |
| 19 | 19 | $headerParts = explode(':', $header); |
| 20 | - for ($i=0; $i<count($this->headerList); $i++) { |
|
| 21 | - if (preg_match("~^" . $headerParts[0] . "~", $this->headerList[$i]) === 1) { |
|
| 20 | + for ($i = 0; $i < count($this->headerList); $i++) { |
|
| 21 | + if (preg_match("~^".$headerParts[0]."~", $this->headerList[$i]) === 1) { |
|
| 22 | 22 | $this->headerList[$i] = $header; |
| 23 | 23 | return; |
| 24 | 24 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $file = $requestUri->getPath(); |
| 37 | 37 | } else { |
| 38 | 38 | $script = explode('/', $_SERVER['SCRIPT_FILENAME']); |
| 39 | - $script[count($script)-1] = ltrim($requestUri->getPath(), '/'); |
|
| 39 | + $script[count($script) - 1] = ltrim($requestUri->getPath(), '/'); |
|
| 40 | 40 | $file = implode('/', $script); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -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 | - $routes[] = (new Route(strtoupper($method), $basePath . $path)) |
|
| 135 | + $routes[] = (new Route(strtoupper($method), $basePath.$path)) |
|
| 136 | 136 | ->withOutputProcessor($outputProcessor) |
| 137 | - ->withClass($parts[count($parts)-2], $parts[count($parts)-1]); |
|
| 137 | + ->withClass($parts[count($parts) - 2], $parts[count($parts) - 1]); |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | protected function sortPaths($pathList) |
| 145 | 145 | { |
| 146 | - usort($pathList, function ($left, $right) { |
|
| 146 | + usort($pathList, function($left, $right) { |
|
| 147 | 147 | if (strpos($left, '{') === false && strpos($right, '{') !== false) { |
| 148 | 148 | return -16384; |
| 149 | 149 | } |
@@ -171,14 +171,14 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | protected function getMethodOutputProcessor($method, $path, $properties) |
| 173 | 173 | { |
| 174 | - $key = strtoupper($method) . " " . $path; |
|
| 174 | + $key = strtoupper($method)." ".$path; |
|
| 175 | 175 | if (isset($this->overrideOutputProcessor[$key])) { |
| 176 | 176 | return $this->overrideOutputProcessor[$key]; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | $produces = null; |
| 180 | 180 | if (isset($properties['produces'])) { |
| 181 | - $produces = (array) $properties['produces']; |
|
| 181 | + $produces = (array)$properties['produces']; |
|
| 182 | 182 | } |
| 183 | 183 | if (empty($produces) && isset($properties["responses"]["200"]["content"])) { |
| 184 | 184 | $produces = array_keys($properties["responses"]["200"]["content"]); |