@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | // TODO cache of valid static routes, maybe with a try, catch, finally? |
72 | - return new Route($url, function (Request $request) { |
|
72 | + return new Route($url, function(Request $request) { |
|
73 | 73 | return response\Page::fromRequest($request); |
74 | 74 | }); |
75 | 75 | } |
76 | 76 | |
77 | - private static function matchDynamicRoute(string $url, string $method = Request::GET): ?Route |
|
77 | + private static function matchDynamicRoute(string $url, string $method = Request::GET): ? Route |
|
78 | 78 | { |
79 | 79 | foreach (self::$routes[$method] as $route => $cb) { |
80 | 80 | if ($route[0] !== substr($route, -1) || $route[0] !== static::$DELIMITER) { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $parameters = array_filter( |
89 | 89 | $matches, |
90 | - function ($v) { |
|
90 | + function($v) { |
|
91 | 91 | return !is_int($v); |
92 | 92 | }, |
93 | 93 | \ARRAY_FILTER_USE_KEY |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $this->route = Router::match($this->url, $this->method); |
63 | 63 | } |
64 | 64 | |
65 | - public function getHeader(string $name): ?string |
|
65 | + public function getHeader(string $name): ? string |
|
66 | 66 | { |
67 | 67 | return $this->headers[$name] ?? null; |
68 | 68 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * |
156 | 156 | * @return Response |
157 | 157 | */ |
158 | - public function response(): ?Response |
|
158 | + public function response(): ? Response |
|
159 | 159 | { |
160 | 160 | $cb = $this->route->callback; |
161 | 161 | $this->parameters = $this->route->parameters; |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @param string $key Dot notation for deeper values, i.e. `user.email` |
174 | 174 | * @return mixed|null |
175 | 175 | */ |
176 | - public function session(?string $key = null) |
|
176 | + public function session(? string $key = null) |
|
177 | 177 | { |
178 | 178 | if (session_status() != PHP_SESSION_ACTIVE) { |
179 | 179 | session_start(); |