@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } else { |
41 | 41 | $closure = Closure::fromCallable($callable); |
42 | 42 | } |
43 | - foreach ((array)$methods as $method) { |
|
43 | + foreach ((array) $methods as $method) { |
|
44 | 44 | self::$routes[$method][$url] = $closure; |
45 | 45 | } |
46 | 46 | } |
@@ -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; |
@@ -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 |
@@ -196,7 +196,7 @@ |
||
196 | 196 | public function response(): ?Response |
197 | 197 | { |
198 | 198 | $cbs = $this->middlewares; |
199 | - $call_eventual_route_at_end_of_chain = function (Request $request, Chain $chain): ?Response { |
|
199 | + $call_eventual_route_at_end_of_chain = function(Request $request, Chain $chain): ?Response { |
|
200 | 200 | $route = $request->route(); |
201 | 201 | if (is_null($route)) { |
202 | 202 | throw new NoRouteSetError("Response called without Route set"); |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | public static function find(array $conditions = [], array $options = []): \Generator |
82 | 82 | { |
83 | 83 | $conditions = self::filterByFields($conditions); |
84 | - $with = array_key_exists('with', $options) ? (array)$options['with'] : false; |
|
84 | + $with = array_key_exists('with', $options) ? (array) $options['with'] : false; |
|
85 | 85 | unset($options['with']); |
86 | 86 | $result = static::db()->find(static::table(), $conditions, $options); |
87 | 87 | $pk = static::pk(); |
88 | - $gen = function () use ($result, $pk, $with) { |
|
88 | + $gen = function() use ($result, $pk, $with) { |
|
89 | 89 | foreach ($result as $row) { |
90 | 90 | $model = new static($row); |
91 | 91 | if ($with) { |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | if (empty($fields) === false) { |
131 | 131 | $data = array_filter( |
132 | 132 | $data, |
133 | - function ($key) use ($fields) { |
|
133 | + function($key) use ($fields) { |
|
134 | 134 | return in_array($key, $fields); |
135 | 135 | }, |
136 | 136 | ARRAY_FILTER_USE_KEY |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | public function query($query, array $params = []); |
15 | 15 | |
16 | - public function one(string $table, array $conditions, array $options = []):?array; |
|
16 | + public function one(string $table, array $conditions, array $options = []): ?array; |
|
17 | 17 | |
18 | 18 | public function find(string $table, array $conditions, array $options = []); |
19 | 19 |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | try { |
132 | 132 | $headfile = $this->getLayoutFile('head'); |
133 | 133 | if (file_exists($headfile)) { |
134 | - (function ($sldkfjlksejflskjflskdjflskdfj) { |
|
134 | + (function($sldkfjlksejflskjflskdjflskdfj) { |
|
135 | 135 | extract($this->data); |
136 | 136 | include $sldkfjlksejflskjflskdjflskdfj; |
137 | 137 | })($headfile); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | $neckfile = $this->getLayoutFile('neck'); |
141 | 141 | if (file_exists($neckfile)) { |
142 | - (function ($lidsinqjhsdfytqkwjkasjdksadsdg) { |
|
142 | + (function($lidsinqjhsdfytqkwjkasjdksadsdg) { |
|
143 | 143 | extract($this->data); |
144 | 144 | include $lidsinqjhsdfytqkwjkasjdksadsdg; |
145 | 145 | })($neckfile); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | ob_start(); |
182 | 182 | try { |
183 | - (function ($ldkfoskdfosjicyvutwehkshfskjdf) { |
|
183 | + (function($ldkfoskdfosjicyvutwehkshfskjdf) { |
|
184 | 184 | extract($this->data); |
185 | 185 | include $ldkfoskdfosjicyvutwehkshfskjdf; |
186 | 186 | })($footfile); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | ob_start(); |
205 | 205 | try { |
206 | 206 | // or another way to hide the file variable? |
207 | - (function ($dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd) { |
|
207 | + (function($dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd) { |
|
208 | 208 | extract($this->data); |
209 | 209 | include $dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd; |
210 | 210 | })($file); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | if (empty($conditions)) { |
139 | 139 | return ""; |
140 | 140 | } |
141 | - $fun = function ($o, $v) use ($conditions) { |
|
141 | + $fun = function($o, $v) use ($conditions) { |
|
142 | 142 | if (is_array($conditions[$v])) { |
143 | 143 | $qa = []; |
144 | 144 | foreach ($conditions[$v] as $key => $value) { |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | private function bindPaginationToStatement(array $options, $stmt): void |
186 | 186 | { |
187 | 187 | if (array_key_exists('limit', $options)) { |
188 | - $stmt->bindValue(":o_offset", (int)($options['offset'] ?? 0), _PDO::PARAM_INT); |
|
189 | - $stmt->bindValue(":o_limit", (int)$options['limit'], _PDO::PARAM_INT); |
|
188 | + $stmt->bindValue(":o_offset", (int) ($options['offset'] ?? 0), _PDO::PARAM_INT); |
|
189 | + $stmt->bindValue(":o_limit", (int) $options['limit'], _PDO::PARAM_INT); |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | private function data(array $data): string |
218 | 218 | { |
219 | - $fun = function ($o, $v) { |
|
219 | + $fun = function($o, $v) { |
|
220 | 220 | return "{$o}, {$v} = :d_{$v}"; |
221 | 221 | }; |
222 | 222 | return trim((string) array_reduce(array_keys($data), $fun, ""), ", "); |