@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | foreach (Assistant::extractRouteAttributes($refMethod) as $route) { |
103 | 103 | $methodName = $refMethod->getName(); |
104 | 104 | $routeUri = $uri . $route->getUri(); |
105 | - Router::match($route->getMethod(), $routeUri, function (...$args) use ($controller, $methodName) { |
|
105 | + Router::match($route->getMethod(), $routeUri, function(...$args) use ($controller, $methodName) { |
|
106 | 106 | Assistant::passDataToMethod($controller, $methodName); |
107 | 107 | }); |
108 | 108 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $routeUri = $uri; |
116 | 116 | } |
117 | 117 | |
118 | - Router::any($routeUri, function (...$args) use ($controller, $methodName) { |
|
118 | + Router::any($routeUri, function(...$args) use ($controller, $methodName) { |
|
119 | 119 | Assistant::passDataToMethod($controller, $methodName); |
120 | 120 | }); |
121 | 121 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } else { |
170 | 170 | $extension = pathinfo($filePath, PATHINFO_EXTENSION); |
171 | 171 | header('Content-Type: ' . PathFinder::getMimeType($extension)); |
172 | - self::get($uri . '/' . $file, function () use ($filePath) { |
|
172 | + self::get($uri . '/' . $file, function() use ($filePath) { |
|
173 | 173 | return file_get_contents($filePath); |
174 | 174 | }); |
175 | 175 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $find = self::find($_SERVER['REQUEST_URI']); |
215 | 215 | $params = $find !== false ? $find['params'] : []; |
216 | 216 | |
217 | - $headers = (function () { |
|
217 | + $headers = (function() { |
|
218 | 218 | $headers = []; |
219 | 219 | foreach ($_SERVER as $key => $value) { |
220 | 220 | if (str_starts_with($key, 'HTTP_')) { |
@@ -60,7 +60,7 @@ |
||
60 | 60 | |
61 | 61 | $last_runs = []; |
62 | 62 | $startTime = time(); |
63 | - Loop::run(function () use (&$last_runs, $startTime) { |
|
63 | + Loop::run(function() use (&$last_runs, $startTime) { |
|
64 | 64 | if (time() - $startTime > 60) { |
65 | 65 | Loop::stop(); |
66 | 66 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | ]); |
59 | 59 | } |
60 | 60 | |
61 | - Router::any('/execute-watchers', function () { |
|
61 | + Router::any('/execute-watchers', function() { |
|
62 | 62 | $this->runWatchers(); |
63 | 63 | }); |
64 | 64 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function resolve(array $options = []): void |
73 | 73 | { |
74 | - set_exception_handler(function (\Throwable $throwable) { |
|
74 | + set_exception_handler(function(\Throwable $throwable) { |
|
75 | 75 | $this->__exception($throwable); |
76 | 76 | die(500); |
77 | 77 | }); |
@@ -102,7 +102,7 @@ |
||
102 | 102 | )); |
103 | 103 | } |
104 | 104 | |
105 | - Router::match($route->getMethod(), $route->getUri(), function () use ($class, $method) { |
|
105 | + Router::match($route->getMethod(), $route->getUri(), function() use ($class, $method) { |
|
106 | 106 | Assistant::passDataToMethod($class, $method); |
107 | 107 | }); |
108 | 108 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | * @author Shahrad Elahi (https://github.com/shahradelahi) |
11 | 11 | * @license https://github.com/utilities-php/router/blob/master/LICENSE (MIT License) |
12 | 12 | */ |
13 | -#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)] |
|
13 | +#[\Attribute(\Attribute::TARGET_CLASS|\Attribute::TARGET_METHOD)] |
|
14 | 14 | class RateLimit |
15 | 15 | { |
16 | 16 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | |
61 | 61 | $last_runs = []; |
62 | 62 | $startTime = time(); |
63 | - Loop::run(function () use (&$last_runs, $startTime) { |
|
63 | + Loop::run(function() use (&$last_runs, $startTime) { |
|
64 | 64 | if (time() - $startTime > 60) { |
65 | 65 | Loop::stop(); |
66 | 66 | } |