@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $scheme = strtolower($scheme); |
70 | 70 | $scheme = (string) preg_replace('#:(//)?$#', '', $scheme); |
71 | 71 | |
72 | - if (! $scheme) { |
|
72 | + if (!$scheme) { |
|
73 | 73 | return ''; |
74 | 74 | } |
75 | 75 | |
@@ -147,11 +147,11 @@ discard block |
||
147 | 147 | */ |
148 | 148 | protected function isStandardPort(): bool |
149 | 149 | { |
150 | - if (! $this->scheme) { |
|
150 | + if (!$this->scheme) { |
|
151 | 151 | return $this->host && $this->port === null; |
152 | 152 | } |
153 | 153 | |
154 | - if (! $this->host || $this->port === null) { |
|
154 | + if (!$this->host || $this->port === null) { |
|
155 | 155 | return true; |
156 | 156 | } |
157 | 157 |
@@ -190,11 +190,11 @@ |
||
190 | 190 | |
191 | 191 | $authority = $this->host; |
192 | 192 | |
193 | - if (! empty($this->userInfo)) { |
|
193 | + if (!empty($this->userInfo)) { |
|
194 | 194 | $authority = $this->userInfo . '@' . $authority; |
195 | 195 | } |
196 | 196 | |
197 | - if (! $this->isStandardPort()) { |
|
197 | + if (!$this->isStandardPort()) { |
|
198 | 198 | $authority .= ':' . $this->port; |
199 | 199 | } |
200 | 200 |
@@ -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 | } |