Passed
Push — master ( 9b8457...f05bc0 )
by Alexander
01:49
created
src/Request.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         return true;
93 93
     }
94 94
 
95
-    public function getHeader(string $name): ?string
95
+    public function getHeader(string $name): ? string
96 96
     {
97 97
         return $this->headers[$name] ?? null;
98 98
     }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     /**
116 116
      * @return interfaces\Route|null Route identified for request if set
117 117
      */
118
-    public function route(): ?interfaces\Route
118
+    public function route(): ? interfaces\Route
119 119
     {
120 120
         return $this->route;
121 121
     }
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
      * @return Response|null
190 190
      * @throws NoRouteSetError if a route has not been set prior to calling this, or by a middleware
191 191
      */
192
-    public function response(): ?Response
192
+    public function response(): ? Response
193 193
     {
194 194
         $cbs = $this->middlewares;
195
-        $call_eventual_route_at_end_of_chain = function(Request $request, Chain $chain): ?Response {
195
+        $call_eventual_route_at_end_of_chain = function(Request $request, Chain $chain): ? Response {
196 196
             $route = $request->route();
197 197
             if (is_null($route)) {
198 198
                 throw new NoRouteSetError("Response called without Route set");
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      * @param string $key Dot notation for deeper values, i.e. `user.email`
229 229
      * @return mixed|interfaces\Session
230 230
      */
231
-    public function session(?string $key = null)
231
+    public function session(? string $key = null)
232 232
     {
233 233
         if (is_null($key)) {
234 234
             return $this->session;
Please login to merge, or discard this patch.
src/Chain.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Route.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/Router.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.