@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | public function query($query, array $params = []); |
| 10 | 10 | |
| 11 | - public function one(string $table, array $conditions, array $options = []):?array; |
|
| 11 | + public function one(string $table, array $conditions, array $options = []): ? array; |
|
| 12 | 12 | |
| 13 | 13 | public function find(string $table, array $conditions, array $options = []); |
| 14 | 14 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | try { |
| 107 | 107 | $headfile = $this->getLayoutFile('head'); |
| 108 | 108 | if (file_exists($headfile)) { |
| 109 | - (function ($sldkfjlksejflskjflskdjflskdfj) { |
|
| 109 | + (function($sldkfjlksejflskjflskdjflskdfj) { |
|
| 110 | 110 | extract($this->data); |
| 111 | 111 | include $sldkfjlksejflskjflskdjflskdfj; |
| 112 | 112 | })($headfile); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | $neckfile = $this->getLayoutFile('neck'); |
| 116 | 116 | if (file_exists($neckfile)) { |
| 117 | - (function ($lidsinqjhsdfytqkwjkasjdksadsdg) { |
|
| 117 | + (function($lidsinqjhsdfytqkwjkasjdksadsdg) { |
|
| 118 | 118 | extract($this->data); |
| 119 | 119 | include $lidsinqjhsdfytqkwjkasjdksadsdg; |
| 120 | 120 | })($neckfile); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | ob_start(); |
| 156 | 156 | try { |
| 157 | - (function ($ldkfoskdfosjicyvutwehkshfskjdf) { |
|
| 157 | + (function($ldkfoskdfosjicyvutwehkshfskjdf) { |
|
| 158 | 158 | extract($this->data); |
| 159 | 159 | include $ldkfoskdfosjicyvutwehkshfskjdf; |
| 160 | 160 | })($footfile); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | ob_start(); |
| 179 | 179 | try { |
| 180 | 180 | // or another way to hide the file variable? |
| 181 | - (function ($dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd) { |
|
| 181 | + (function($dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd) { |
|
| 182 | 182 | extract($this->data); |
| 183 | 183 | include $dsfjskdfjsdlkfjsdkfjsdkfjsdlkfjsd; |
| 184 | 184 | })($file); |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | * @param null|string $url |
| 220 | 220 | * @return string |
| 221 | 221 | */ |
| 222 | - private function templateFromUrl(?string $url = null): string |
|
| 222 | + private function templateFromUrl(?string $url = null) : string |
|
| 223 | 223 | { |
| 224 | 224 | $parts = \explode('/', $url); |
| 225 | 225 | $last = \array_slice($parts, -1, 1, true); |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | * @param Closure|null $close an optional anonymous function that takes the connection as arguments and closes it |
| 30 | 30 | * @throws InvalidArgumentException if connection $name already exists |
| 31 | 31 | */ |
| 32 | - public static function add(string $name, Closure $open, ?Closure $close = null): void |
|
| 32 | + public static function add(string $name, Closure $open, ?Closure $close = null) : void |
|
| 33 | 33 | { |
| 34 | 34 | if (isset(self::$open[$name])) { |
| 35 | 35 | throw new InvalidArgumentException("Connection $name already exists"); |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | throw new \Exception("Query method is not implemented for MongDB"); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - public function one(string $collection_name, array $conditions, array $options = []): ?array |
|
| 82 | + public function one(string $collection_name, array $conditions, array $options = []): ? array |
|
| 83 | 83 | { |
| 84 | 84 | $collection = $this->collection($collection_name); |
| 85 | 85 | $conditions = $this->idReplaceConditions($conditions); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | return self::$settings[$environment][$config_name]; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - public static function grab(?string $environment = null): array |
|
| 63 | + public static function grab(?string $environment = null) : array |
|
| 64 | 64 | { |
| 65 | 65 | if (is_null($environment)) { |
| 66 | 66 | $environment = static::current(); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @param mixed $value |
| 79 | 79 | * @param null|string $environment if not specified, configures CURRENT environment only. E::ALL, sets for all envs. |
| 80 | 80 | */ |
| 81 | - public static function put(string $config_name, $value, ?string $environment = null): void |
|
| 81 | + public static function put(string $config_name, $value, ?string $environment = null) : void |
|
| 82 | 82 | { |
| 83 | 83 | if (is_null($environment)) { |
| 84 | 84 | $environment = static::current(); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @param array $configs |
| 103 | 103 | * @param null|string $environment |
| 104 | 104 | */ |
| 105 | - public static function add(array $configs, ?string $environment = null): void |
|
| 105 | + public static function add(array $configs, ?string $environment = null) : void |
|
| 106 | 106 | { |
| 107 | 107 | if (is_null($environment)) { |
| 108 | 108 | $environment = static::current(); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * @param array $configs |
| 127 | 127 | * @param null|string $environment |
| 128 | 128 | */ |
| 129 | - public static function set(array $configs, ?string $environment = null): void |
|
| 129 | + public static function set(array $configs, ?string $environment = null) : void |
|
| 130 | 130 | { |
| 131 | 131 | if (is_null($environment)) { |
| 132 | 132 | $environment = static::current(); |
@@ -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"); |
@@ -74,11 +74,11 @@ discard block |
||
| 74 | 74 | public static function find(array $conditions = [], array $options = []): \Generator |
| 75 | 75 | { |
| 76 | 76 | $conditions = self::filterByFields($conditions); |
| 77 | - $with = array_key_exists('with', $options) ? (array)$options['with'] : false; |
|
| 77 | + $with = array_key_exists('with', $options) ? (array) $options['with'] : false; |
|
| 78 | 78 | unset($options['with']); |
| 79 | 79 | $result = static::db()->find(static::table(), $conditions, $options); |
| 80 | 80 | $pk = static::pk(); |
| 81 | - $gen = function () use ($result, $pk, $with) { |
|
| 81 | + $gen = function() use ($result, $pk, $with) { |
|
| 82 | 82 | foreach ($result as $row) { |
| 83 | 83 | $model = new static($row); |
| 84 | 84 | if ($with) { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | return iterator_to_array($generator); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - public static function fields(): ?array |
|
| 115 | + public static function fields(): ? array |
|
| 116 | 116 | { |
| 117 | 117 | return isset(static::$fields) ? static::$fields : null; |
| 118 | 118 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | if (empty($fields) === false) { |
| 124 | 124 | $data = array_filter( |
| 125 | 125 | $data, |
| 126 | - function ($key) use ($fields) { |
|
| 126 | + function($key) use ($fields) { |
|
| 127 | 127 | return in_array($key, $fields); |
| 128 | 128 | }, |
| 129 | 129 | ARRAY_FILTER_USE_KEY |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | $this->data = $data; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - abstract public static function fields(): ?array; |
|
| 35 | + abstract public static function fields(): ? array; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * @param $name |