@@ -11,7 +11,7 @@ |
||
11 | 11 | $this->chain = $chained_callable; |
12 | 12 | } |
13 | 13 | |
14 | - public function next(Request $request): ?Response |
|
14 | + public function next(Request $request): ? Response |
|
15 | 15 | { |
16 | 16 | if (empty($this->chain)) { |
17 | 17 | throw new exceptions\EmptyChainError; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param Closure $cb |
34 | 34 | * @param array $parameters |
35 | 35 | */ |
36 | - public function __construct(string $url, ?Closure $cb, array $parameters = []) |
|
36 | + public function __construct(string $url, ? Closure $cb, array $parameters = []) |
|
37 | 37 | { |
38 | 38 | $this->url = $url; |
39 | 39 | $this->callback = $cb; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @return Response|null |
56 | 56 | * @throws InvalidCallback if callback did not return Response|null |
57 | 57 | */ |
58 | - public function __invoke(Request $request): ?Response |
|
58 | + public function __invoke(Request $request): ? Response |
|
59 | 59 | { |
60 | 60 | $response = call_user_func_array($this->callback, [$request]); |
61 | 61 | if (is_null($response) || $response instanceof Response) { |
@@ -69,7 +69,7 @@ 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 | $page = response\Page::fromRequest($request); |
74 | 74 | if ($page->isValid()) { |
75 | 75 | return $page; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | }); |
78 | 78 | } |
79 | 79 | |
80 | - private static function matchDynamicRoute(string $url, string $method = Request::GET): ?interfaces\Route |
|
80 | + private static function matchDynamicRoute(string $url, string $method = Request::GET): ? interfaces\Route |
|
81 | 81 | { |
82 | 82 | foreach (self::$routes[$method] as $route => $cb) { |
83 | 83 | if ($route[0] !== substr($route, -1) || $route[0] !== static::$DELIMITER) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | $parameters = array_filter( |
92 | 92 | $matches, |
93 | - function ($v) { |
|
93 | + function($v) { |
|
94 | 94 | return !is_int($v); |
95 | 95 | }, |
96 | 96 | \ARRAY_FILTER_USE_KEY |