Passed
Push — master ( 934a9a...abb035 )
by Melech
06:13
created
src/Valkyrja/Http/Uris/UriHelpers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Valkyrja/Http/Uris/Uri.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -190,11 +190,11 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
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.