@@ -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 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @param string $key Dot notation for deeper values, i.e. `user.email` |
173 | 173 | * @return mixed|null |
174 | 174 | */ |
175 | - public function session(?string $key = null) |
|
175 | + public function session(? string $key = null) |
|
176 | 176 | { |
177 | 177 | if (session_status() != PHP_SESSION_ACTIVE) { |
178 | 178 | session_start(); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | try { |
95 | 95 | $headfile = $this->getLayoutFile('head'); |
96 | 96 | if (file_exists($headfile)) { |
97 | - (function ($sldkfjlksejflskjflskdjflskdfj) { |
|
97 | + (function($sldkfjlksejflskjflskdjflskdfj) { |
|
98 | 98 | extract($this->data); |
99 | 99 | include $sldkfjlksejflskjflskdjflskdfj; |
100 | 100 | })($headfile); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | $neckfile = $this->getLayoutFile('neck'); |
104 | 104 | if (file_exists($neckfile)) { |
105 | - (function ($lidsinqjhsdfytqkwjkasjdksadsdg) { |
|
105 | + (function($lidsinqjhsdfytqkwjkasjdksadsdg) { |
|
106 | 106 | extract($this->data); |
107 | 107 | include $lidsinqjhsdfytqkwjkasjdksadsdg; |
108 | 108 | })($neckfile); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | ob_start(); |
144 | 144 | try { |
145 | - (function ($ldkfoskdfosjicyvutwehkshfskjdf) { |
|
145 | + (function($ldkfoskdfosjicyvutwehkshfskjdf) { |
|
146 | 146 | extract($this->data); |
147 | 147 | include $ldkfoskdfosjicyvutwehkshfskjdf; |
148 | 148 | })($footfile); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | ob_start(); |
170 | 170 | try { |
171 | 171 | // or another way to hide the file variable? |
172 | - (function ($dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd) { |
|
172 | + (function($dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd) { |
|
173 | 173 | extract($this->data); |
174 | 174 | include $dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd; |
175 | 175 | })($file); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * @param null|string $url |
213 | 213 | * @return string |
214 | 214 | */ |
215 | - private function templateFromUrl(?string $url = null): string |
|
215 | + private function templateFromUrl(? string $url = null) : string |
|
216 | 216 | { |
217 | 217 | $parts = \explode('/', $url); |
218 | 218 | $last = \array_slice($parts, -1, 1, true); |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | // TODO cache of valid static routes, maybe with a try, catch, finally? |
65 | - return new Route($url, function (Request $request) { |
|
65 | + return new Route($url, function(Request $request) { |
|
66 | 66 | return response\Page::fromRequest($request); |
67 | 67 | }); |
68 | 68 | } |
69 | 69 | |
70 | - private static function matchDynamicRoute(string $url, string $method = Request::GET): ?Route |
|
70 | + private static function matchDynamicRoute(string $url, string $method = Request::GET): ? Route |
|
71 | 71 | { |
72 | 72 | foreach (self::$routes[$method] as $route => $cb) { |
73 | 73 | if ($route[0] !== substr($route, -1) || $route[0] !== static::$DELIMITER) { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | $parameters = array_filter( |
82 | 82 | $matches, |
83 | - function ($v) { |
|
83 | + function($v) { |
|
84 | 84 | return !is_int($v); |
85 | 85 | }, |
86 | 86 | ARRAY_FILTER_USE_KEY |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | public function __call(string $method, array $args = []) |
40 | 40 | { |
41 | - $refresh = (bool) array_shift($args); |
|
41 | + $refresh = (bool)array_shift($args); |
|
42 | 42 | return $this->getRelatedModel($method, $refresh); |
43 | 43 | } |
44 | 44 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | /** |
64 | 64 | * @param string[] ...$relation_names any list of relations to return |
65 | - * @return object instance of class that has Entity trait |
|
65 | + * @return Entity instance of class that has Entity trait |
|
66 | 66 | */ |
67 | 67 | public function with(string ...$relation_names) |
68 | 68 | { |