@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | string $method, |
135 | 135 | string $requestedPath, |
136 | 136 | string $folder = '', |
137 | - ?string $cachedFile = null |
|
137 | + ? string $cachedFile = null |
|
138 | 138 | ) { |
139 | 139 | if (!in_array($method, self::$validRequestMethods, true)) { |
140 | 140 | $message = sprintf('%s is not valid Http request method.', $method); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @throws InvalidArgumentException |
174 | 174 | * @throws UnexpectedValueException |
175 | 175 | */ |
176 | - public function add($requestMethods, string $route, string $action, ?string $returnType = null, ?string $alias = null) |
|
176 | + public function add($requestMethods, string $route, string $action, ? string $returnType = null, ? string $alias = null) |
|
177 | 177 | { |
178 | 178 | $requestMethodsGiven = is_array($requestMethods) ? (array) $requestMethods : [0 => $requestMethods]; |
179 | 179 | $returnType = $this->determineReturnType($returnType); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * @param string|null $returnType |
212 | 212 | * @return string |
213 | 213 | */ |
214 | - private function determineReturnType(?string $returnType) : string |
|
214 | + private function determineReturnType(? string $returnType) : string |
|
215 | 215 | { |
216 | 216 | if ($returnType === null) { |
217 | 217 | return $this->defaultReturnType; |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | $this->cachedFile, |
303 | 303 | '<?php return ' . var_export($dispatchData, true) . ';' |
304 | 304 | ); |
305 | - return new $options['dispatcher']($dispatchData ); |
|
305 | + return new $options['dispatcher']($dispatchData); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | /** |
@@ -311,10 +311,10 @@ discard block |
||
311 | 311 | */ |
312 | 312 | private function addRoutes(FastRoute\RouteCollector $route) : void |
313 | 313 | { |
314 | - $routeIndex=0; |
|
314 | + $routeIndex = 0; |
|
315 | 315 | foreach ($this->routes as $definedRoute) { |
316 | 316 | $definedRoute[3] = $definedRoute[3] ?? $this->defaultReturnType; |
317 | - $routeName = 'routeClosure'.$routeIndex; |
|
317 | + $routeName = 'routeClosure' . $routeIndex; |
|
318 | 318 | [$null1, $null2, $controller, $returnType] = $definedRoute; |
319 | 319 | $returnType = Router::$translations[$returnType] ?? $this->defaultReturnType; |
320 | 320 | $this->routerClosures[$routeName] = function($args) use ($controller, $returnType) { |