Completed
Push — master ( 6faa20...05d108 )
by Melech
04:48
created
src/Valkyrja/Http/Responses/JsonResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@
 block discarded – undo
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
                 );
Please login to merge, or discard this patch.
src/Valkyrja/Routing/Middleware/ValidateRequestMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Valkyrja/Routing/Middleware/VerifyAuthBroadcastMiddleware.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,17 +59,17 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Valkyrja/Routing/Middleware/CacheResponseMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Valkyrja/Routing/Collections/Collection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -308,7 +308,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Valkyrja/Routing/Matchers/Matcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Valkyrja/Routing/Annotation/Annotators/Annotator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Valkyrja/Routing/Dispatchers/Router.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Valkyrja/Routing/Commands/RoutesList.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.