@@ -187,7 +187,7 @@ |
||
187 | 187 | $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u'; |
188 | 188 | |
189 | 189 | foreach (explode('.', $callback) as $part) { |
190 | - if (! preg_match($pattern, $part)) { |
|
190 | + if (!preg_match($pattern, $part)) { |
|
191 | 191 | throw new InvalidArgumentException( |
192 | 192 | 'The callback name is not valid.' |
193 | 193 | ); |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $validator = $container->getSingleton(Validator::class); |
42 | 42 | $validator->setRules(static::getRules($request)); |
43 | 43 | |
44 | - if (! $validator->validate()) { |
|
44 | + if (!$validator->validate()) { |
|
45 | 45 | /** @var ResponseFactory $responseFactory */ |
46 | 46 | $responseFactory = $container->getSingleton(ResponseFactory::class); |
47 | 47 |
@@ -59,17 +59,17 @@ |
||
59 | 59 | $broadcastMessage = static::getBroadCastMessageFromRequest($request); |
60 | 60 | |
61 | 61 | // Ensure a broadcast message exists |
62 | - if (! $broadcastMessage) { |
|
62 | + if (!$broadcastMessage) { |
|
63 | 63 | return static::getNoBroadcastMessageResponse($responseFactory); |
64 | 64 | } |
65 | 65 | |
66 | 66 | // Ensure a user is logged in |
67 | - if (! $auth->isLoggedIn()) { |
|
67 | + if (!$auth->isLoggedIn()) { |
|
68 | 68 | return static::getNoAuthUserResponse($responseFactory); |
69 | 69 | } |
70 | 70 | |
71 | 71 | // Ensure the logged in user can read the broadcast message |
72 | - if (! static::determineCanRead($auth->getUser(), $broadcaster, $broadcastMessage)) { |
|
72 | + if (!static::determineCanRead($auth->getUser(), $broadcaster, $broadcastMessage)) { |
|
73 | 73 | return static::getCannotReadResponse($responseFactory); |
74 | 74 | } |
75 | 75 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | { |
50 | 50 | $filePath = Directory::cachePath('response/' . static::getHashedPath($request)); |
51 | 51 | |
52 | - if (is_file($filePath) && ! self::$router->debug()) { |
|
52 | + if (is_file($filePath) && !self::$router->debug()) { |
|
53 | 53 | if (time() - filemtime($filePath) > self::$router->getConfig()['cacheMiddleWareTTL']) { |
54 | 54 | unlink($filePath); |
55 | 55 |
@@ -308,7 +308,7 @@ |
||
308 | 308 | */ |
309 | 309 | protected function verifyRoute(Route $route): void |
310 | 310 | { |
311 | - if (! $route->getPath()) { |
|
311 | + if (!$route->getPath()) { |
|
312 | 312 | throw new InvalidArgumentException('Invalid path defined in route.'); |
313 | 313 | } |
314 | 314 | } |
@@ -155,7 +155,7 @@ |
||
155 | 155 | // Iterate through the matches |
156 | 156 | foreach ($matches as $key => $match) { |
157 | 157 | // If there is no match (middle of regex optional group) |
158 | - if (! $match) { |
|
158 | + if (!$match) { |
|
159 | 159 | // Set the value to null so the controller's action |
160 | 160 | // can use the default it sets |
161 | 161 | $matches[$key] = null; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $classAnnotations = $this->getClassAnnotations($class); |
104 | 104 | |
105 | 105 | // If this route's class has annotations |
106 | - if (! empty($classAnnotations)) { |
|
106 | + if (!empty($classAnnotations)) { |
|
107 | 107 | /** @var Route $annotation */ |
108 | 108 | // Iterate through all the annotations |
109 | 109 | foreach ($classAnnotations as $annotation) { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | protected function setRouteProperties(Route $route): void |
160 | 160 | { |
161 | - if (! $route->getClass()) { |
|
161 | + if (!$route->getClass()) { |
|
162 | 162 | throw new InvalidArgumentException('Invalid class defined in route.'); |
163 | 163 | } |
164 | 164 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | { |
226 | 226 | $newRoute = clone $route; |
227 | 227 | |
228 | - if (! $route->getPath()) { |
|
228 | + if (!$route->getPath()) { |
|
229 | 229 | throw new InvalidArgumentException('Invalid path defined in route.'); |
230 | 230 | } |
231 | 231 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | protected function validatePath(string $path): string |
281 | 281 | { |
282 | 282 | // Trim slashes from the beginning and end of the path |
283 | - if (! $path = trim($path, '/')) { |
|
283 | + if (!$path = trim($path, '/')) { |
|
284 | 284 | // If the path only had a slash return as just slash |
285 | 285 | return '/'; |
286 | 286 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | public function getRoute(string $name): Route |
207 | 207 | { |
208 | 208 | // If no route was found |
209 | - if (! $this->hasRoute($name) || ! $route = self::$collection->getNamed($name)) { |
|
209 | + if (!$this->hasRoute($name) || !$route = self::$collection->getNamed($name)) { |
|
210 | 210 | throw new InvalidRouteName($name); |
211 | 211 | } |
212 | 212 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | protected function determineIsSecureRoute(Request $request, Route $route): void |
324 | 324 | { |
325 | 325 | // If the route is secure and the current request is not secure |
326 | - if ($route->isSecure() && ! $request->getUri()->isSecure()) { |
|
326 | + if ($route->isSecure() && !$request->getUri()->isSecure()) { |
|
327 | 327 | // Throw the redirect to the secure path |
328 | 328 | $this->responseFactory->createRedirectResponse()->secure($request->getUri()->getPath(), $request)->throw(); |
329 | 329 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | 'Name', |
69 | 69 | 'Dispatch', |
70 | 70 | ]; |
71 | - $lengths = [ |
|
71 | + $lengths = [ |
|
72 | 72 | strlen($headerTexts[0]), |
73 | 73 | strlen($headerTexts[1]), |
74 | 74 | strlen($headerTexts[2]), |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | ]; |
77 | 77 | |
78 | 78 | // Sort routes by path |
79 | - usort($routerRoutes, fn (Route $a, Route $b) => $a->getPath() <=> $b->getPath()); |
|
79 | + usort($routerRoutes, fn(Route $a, Route $b) => $a->getPath() <=> $b->getPath()); |
|
80 | 80 | |
81 | 81 | foreach ($routerRoutes as $route) { |
82 | 82 | $this->setRoute($route, $routes, $lengths); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $sepLine = $this->getSepLine($lengths); |
86 | 86 | $odd = false; |
87 | 87 | |
88 | - output()->writeMessage($this->oddFormat(! $odd) . $sepLine, true); |
|
88 | + output()->writeMessage($this->oddFormat(!$odd) . $sepLine, true); |
|
89 | 89 | $this->headerMessage($headerTexts, $lengths); |
90 | 90 | output()->writeMessage($sepLine, true); |
91 | 91 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | output()->writeMessage($routeMessage . static::END_FORMAT, true); |
111 | 111 | } |
112 | 112 | |
113 | - output()->writeMessage($this->oddFormat(! $odd) . $sepLine . static::END_FORMAT, true); |
|
113 | + output()->writeMessage($this->oddFormat(!$odd) . $sepLine . static::END_FORMAT, true); |
|
114 | 114 | |
115 | 115 | return 0; |
116 | 116 | } |