Passed
Push — main ( 57b38b...aec17e )
by Dimitri
04:13
created
src/Router/AutoRouter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             $class = $this->translateURIDashes(ucfirst($segment));
134 134
 
135 135
             // dès que nous rencontrons un segment qui n'est pas compatible PSR-4, arrêter la recherche
136
-            if (! $this->isValidSegment($class)) {
136
+            if (!$this->isValidSegment($class)) {
137 137
                 return false;
138 138
             }
139 139
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
             throw new MethodNotFoundException();
342 342
         }
343 343
 
344
-        if (! $refMethod->isPublic()) {
344
+        if (!$refMethod->isPublic()) {
345 345
             throw new MethodNotFoundException();
346 346
         }
347 347
 
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
      */
455 455
     public function directory(): string
456 456
     {
457
-        return ! empty($this->directory) ? $this->directory : '';
457
+        return !empty($this->directory) ? $this->directory : '';
458 458
     }
459 459
 
460 460
     /**
Please login to merge, or discard this patch.
src/Http/Concerns/InteractsWithInput.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $input = $this->all();
88 88
 
89 89
         foreach ($keys as $value) {
90
-            if (! Arr::has($input, $value)) {
90
+            if (!Arr::has($input, $value)) {
91 91
                 return false;
92 92
             }
93 93
         }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $keys = is_array($key) ? $key : func_get_args();
150 150
 
151 151
         foreach ($keys as $value) {
152
-            if (! $this->isEmptyString($value)) {
152
+            if (!$this->isEmptyString($value)) {
153 153
                 return false;
154 154
             }
155 155
         }
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     {
199 199
         $keys = is_array($key) ? $key : func_get_args();
200 200
 
201
-        return ! $this->has($keys);
201
+        return !$this->has($keys);
202 202
     }
203 203
 
204 204
     /**
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     {
227 227
         $value = $this->data($key);
228 228
 
229
-        return ! is_bool($value) && ! is_array($value) && trim((string) $value) === '';
229
+        return !is_bool($value) && !is_array($value) && trim((string) $value) === '';
230 230
     }
231 231
 
232 232
     /**
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     {
247 247
         $input = array_replace_recursive($this->data(), $this->allFiles());
248 248
 
249
-        if (! $keys) {
249
+        if (!$keys) {
250 250
             return $input;
251 251
         }
252 252
 
@@ -341,9 +341,9 @@  discard block
 block discarded – undo
341 341
     public function enum(string $key, $enumClass)
342 342
     {
343 343
         if ($this->isNotFilled($key)
344
-            || ! function_exists('enum_exists')
345
-            || ! enum_exists($enumClass)
346
-            || ! method_exists($enumClass, 'tryFrom')) {
344
+            || !function_exists('enum_exists')
345
+            || !enum_exists($enumClass)
346
+            || !method_exists($enumClass, 'tryFrom')) {
347 347
             return null;
348 348
         }
349 349
 
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
      */
458 458
     public function hasFile(string $key): bool
459 459
     {
460
-        if (! is_array($files = $this->file($key))) {
460
+        if (!is_array($files = $this->file($key))) {
461 461
             $files = [$files];
462 462
         }
463 463
 
Please login to merge, or discard this patch.
src/Http/Request.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     public function validation(array|string $rules, array $messages = []): Validation
57 57
     {
58 58
         if (is_string($rules)) {
59
-            if (! class_exists($rules) || ! is_subclass_of($rules, DataValidation::class)) {
59
+            if (!class_exists($rules) || !is_subclass_of($rules, DataValidation::class)) {
60 60
                 throw new InvalidArgumentException();
61 61
             }
62 62
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function fullUrl(): string
143 143
     {
144
-        if (! empty($query = $this->getEnv('QUERY_STRING'))) {
144
+        if (!empty($query = $this->getEnv('QUERY_STRING'))) {
145 145
             return $this->url() . '?' . $query;
146 146
         }
147 147
 
Please login to merge, or discard this patch.
src/Http/ServerRequest.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
         $this->cookies = $config['cookies'];
235 235
 
236 236
         if (isset($config['uri'])) {
237
-            if (! $config['uri'] instanceof UriInterface) {
237
+            if (!$config['uri'] instanceof UriInterface) {
238 238
                 throw new FrameworkException('The `uri` key must be an instance of ' . UriInterface::class);
239 239
             }
240 240
             $uri = $config['uri'];
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
         }
438 438
 
439 439
         $type = strtolower($type);
440
-        if (! isset(static::$_detectors[$type])) {
440
+        if (!isset(static::$_detectors[$type])) {
441 441
             return false;
442 442
         }
443 443
         if ($args) {
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
     public function isAll(array $types): bool
590 590
     {
591 591
         foreach ($types as $type) {
592
-            if (! $this->is($type)) {
592
+            if (!$this->is($type)) {
593 593
                 return false;
594 594
             }
595 595
         }
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
     protected function normalizeHeaderName(string $name): string
694 694
     {
695 695
         $name = str_replace('-', '_', strtoupper($name));
696
-        if (! in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) {
696
+        if (!in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) {
697 697
             $name = 'HTTP_' . $name;
698 698
         }
699 699
 
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
     {
872 872
         $new = clone $this;
873 873
 
874
-        if (! preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) {
874
+        if (!preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) {
875 875
             throw new InvalidArgumentException(sprintf(
876 876
                 'Méthode HTTP non prise en charge "%s" fournie',
877 877
                 $method
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
                 }
1134 1134
             }
1135 1135
 
1136
-            if (! isset($accept[$prefValue])) {
1136
+            if (!isset($accept[$prefValue])) {
1137 1137
                 $accept[$prefValue] = [];
1138 1138
             }
1139 1139
             if ($prefValue) {
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
         if ($name === null) {
1212 1212
             return $this->data;
1213 1213
         }
1214
-        if (! is_array($this->data)) {
1214
+        if (!is_array($this->data)) {
1215 1215
             return $default;
1216 1216
         }
1217 1217
 
@@ -1351,7 +1351,7 @@  discard block
 block discarded – undo
1351 1351
      */
1352 1352
     public function withProtocolVersion(string $version): static
1353 1353
     {
1354
-        if (! preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) {
1354
+        if (!preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) {
1355 1355
             throw new InvalidArgumentException(sprintf('Version de protocole `%s` non prise en charge fournie.', $version));
1356 1356
         }
1357 1357
         $new           = clone $this;
@@ -1373,7 +1373,7 @@  discard block
 block discarded – undo
1373 1373
     public function getEnv(string $key, ?string $default = null): ?string
1374 1374
     {
1375 1375
         $key = strtoupper($key);
1376
-        if (! array_key_exists($key, $this->_environment) || null === $this->_environment[$key]) {
1376
+        if (!array_key_exists($key, $this->_environment) || null === $this->_environment[$key]) {
1377 1377
             $this->_environment[$key] = env($key, $default);
1378 1378
         }
1379 1379
 
@@ -1590,7 +1590,7 @@  discard block
 block discarded – undo
1590 1590
         $file = Arr::get($this->uploadedFiles, $path);
1591 1591
         if (is_array($file)) {
1592 1592
             foreach ($file as $f) {
1593
-                if (! ($f instanceof UploadedFile)) {
1593
+                if (!($f instanceof UploadedFile)) {
1594 1594
                     return null;
1595 1595
                 }
1596 1596
             }
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
             return $file;
1599 1599
         }
1600 1600
 
1601
-        if (! ($file instanceof UploadedFileInterface)) {
1601
+        if (!($file instanceof UploadedFileInterface)) {
1602 1602
             return null;
1603 1603
         }
1604 1604
 
@@ -1646,7 +1646,7 @@  discard block
 block discarded – undo
1646 1646
                 continue;
1647 1647
             }
1648 1648
 
1649
-            if (! $file instanceof UploadedFileInterface) {
1649
+            if (!$file instanceof UploadedFileInterface) {
1650 1650
                 throw new InvalidArgumentException("Fichier invalide à '{$path}{$key}'");
1651 1651
             }
1652 1652
         }
@@ -1697,7 +1697,7 @@  discard block
 block discarded – undo
1697 1697
         }
1698 1698
 
1699 1699
         $host = $uri->getHost();
1700
-        if (! $host) {
1700
+        if (!$host) {
1701 1701
             return $new;
1702 1702
         }
1703 1703
         $port = $uri->getPort();
@@ -1805,7 +1805,7 @@  discard block
 block discarded – undo
1805 1805
         $validLocales = config('app.supported_locales');
1806 1806
         // S'il ne s'agit pas d'un paramètre régional valide, définissez-le
1807 1807
         // aux paramètres régionaux par défaut du site.
1808
-        if (! in_array($locale, $validLocales, true)) {
1808
+        if (!in_array($locale, $validLocales, true)) {
1809 1809
             $locale = config('app.language');
1810 1810
         }
1811 1811
 
@@ -1905,7 +1905,7 @@  discard block
 block discarded – undo
1905 1905
             $override = true;
1906 1906
         }
1907 1907
 
1908
-        if ($override && ! in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) {
1908
+        if ($override && !in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) {
1909 1909
             $data = [];
1910 1910
         }
1911 1911
 
@@ -1955,7 +1955,7 @@  discard block
 block discarded – undo
1955 1955
      */
1956 1956
     protected function _processFiles(array $post, array $files): array
1957 1957
     {
1958
-        if (! is_array($files)) {
1958
+        if (!is_array($files)) {
1959 1959
             return $post;
1960 1960
         }
1961 1961
 
Please login to merge, or discard this patch.
src/View/Adapters/SmartyAdapter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $this->renderVars['file'] = $this->getRenderedFile($options, $this->renderVars['view'], 'tpl');
62 62
 
63 63
         $layout = $this->layout;
64
-        if (! empty($layout)) {
64
+        if (!empty($layout)) {
65 65
             if (empty(pathinfo($layout, PATHINFO_EXTENSION))) {
66 66
                 $layout .= '.tpl';
67 67
             }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $this->engine->assign($this->data);
72 72
 
73 73
         // Doit-on mettre en cache?
74
-        if (! empty($this->renderVars['options']['cache_name']) || ! empty($this->renderVars['options']['cache'])) {
74
+        if (!empty($this->renderVars['options']['cache_name']) || !empty($this->renderVars['options']['cache'])) {
75 75
             $this->enableCache();
76 76
             $this->engine->setCacheLifetime(60 * ($this->renderVars['options']['cache'] ?? 60));
77 77
             $this->engine->setCompileId($this->renderVars['options']['cache_name'] ?? null);
Please login to merge, or discard this patch.
src/Helpers/inflector.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 use BlitzPHP\Utilities\String\Inflector;
13 13
 use BlitzPHP\Utilities\String\Text;
14 14
 
15
-if (! function_exists('camelize')) {
15
+if (!function_exists('camelize')) {
16 16
     /**
17 17
      * Camelize
18 18
      *
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     }
27 27
 }
28 28
 
29
-if (! function_exists('classify')) {
29
+if (!function_exists('classify')) {
30 30
     /**
31 31
      * Returns model class name ("Person" for the database table "people".) for given database table.
32 32
      *
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     }
41 41
 }
42 42
 
43
-if (! function_exists('dasherize')) {
43
+if (!function_exists('dasherize')) {
44 44
     /**
45 45
      * Returns the input CamelCasedString as an dashed-string.
46 46
      *
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     }
57 57
 }
58 58
 
59
-if (! function_exists('delimit')) {
59
+if (!function_exists('delimit')) {
60 60
     /**
61 61
      * Expects a CamelCasedInputString, and produces a lower_case_delimited_string
62 62
      *
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     }
72 72
 }
73 73
 
74
-if (! function_exists('humanize')) {
74
+if (!function_exists('humanize')) {
75 75
     /**
76 76
      * Humanize
77 77
      *
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     }
87 87
 }
88 88
 
89
-if (! function_exists('plural')) {
89
+if (!function_exists('plural')) {
90 90
     /**
91 91
      * Plural
92 92
      *
@@ -96,30 +96,30 @@  discard block
 block discarded – undo
96 96
     {
97 97
         $result = $string;
98 98
 
99
-        if (! is_pluralizable($result)) {
99
+        if (!is_pluralizable($result)) {
100 100
             return $result;
101 101
         }
102 102
 
103 103
         $plural_rules = [
104
-            '/(quiz)$/'               => '\1zes',      // quizzes
105
-            '/^(ox)$/'                => '\1\2en',     // ox
106
-            '/([m|l])ouse$/'          => '\1ice',      // mouse, louse
107
-            '/(matr|vert|ind)ix|ex$/' => '\1ices',     // matrix, vertex, index
108
-            '/(x|ch|ss|sh)$/'         => '\1es',       // search, switch, fix, box, process, address
109
-            '/([^aeiouy]|qu)y$/'      => '\1ies',      // query, ability, agency
110
-            '/(hive)$/'               => '\1s',        // archive, hive
111
-            '/(?:([^f])fe|([lr])f)$/' => '\1\2ves',    // half, safe, wife
112
-            '/sis$/'                  => 'ses',        // basis, diagnosis
113
-            '/([ti])um$/'             => '\1a',        // datum, medium
114
-            '/(p)erson$/'             => '\1eople',    // person, salesperson
115
-            '/(m)an$/'                => '\1en',       // man, woman, spokesman
116
-            '/(c)hild$/'              => '\1hildren',  // child
117
-            '/(buffal|tomat)o$/'      => '\1\2oes',    // buffalo, tomato
118
-            '/(bu|campu)s$/'          => '\1\2ses',    // bus, campus
119
-            '/(alias|status|virus)$/' => '\1es',       // alias
120
-            '/(octop)us$/'            => '\1i',        // octopus
121
-            '/(ax|cris|test)is$/'     => '\1es',       // axis, crisis
122
-            '/s$/'                    => 's',          // no change (compatibility)
104
+            '/(quiz)$/'               => '\1zes', // quizzes
105
+            '/^(ox)$/'                => '\1\2en', // ox
106
+            '/([m|l])ouse$/'          => '\1ice', // mouse, louse
107
+            '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index
108
+            '/(x|ch|ss|sh)$/'         => '\1es', // search, switch, fix, box, process, address
109
+            '/([^aeiouy]|qu)y$/'      => '\1ies', // query, ability, agency
110
+            '/(hive)$/'               => '\1s', // archive, hive
111
+            '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife
112
+            '/sis$/'                  => 'ses', // basis, diagnosis
113
+            '/([ti])um$/'             => '\1a', // datum, medium
114
+            '/(p)erson$/'             => '\1eople', // person, salesperson
115
+            '/(m)an$/'                => '\1en', // man, woman, spokesman
116
+            '/(c)hild$/'              => '\1hildren', // child
117
+            '/(buffal|tomat)o$/'      => '\1\2oes', // buffalo, tomato
118
+            '/(bu|campu)s$/'          => '\1\2ses', // bus, campus
119
+            '/(alias|status|virus)$/' => '\1es', // alias
120
+            '/(octop)us$/'            => '\1i', // octopus
121
+            '/(ax|cris|test)is$/'     => '\1es', // axis, crisis
122
+            '/s$/'                    => 's', // no change (compatibility)
123 123
             '/$/'                     => 's',
124 124
         ];
125 125
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     }
135 135
 }
136 136
 
137
-if (! function_exists('pluralize')) {
137
+if (!function_exists('pluralize')) {
138 138
     /**
139 139
      * Return $word in plural form.
140 140
      *
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     }
149 149
 }
150 150
 
151
-if (! function_exists('singular')) {
151
+if (!function_exists('singular')) {
152 152
     /**
153 153
      * Singular
154 154
      *
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     {
159 159
         $result = $string;
160 160
 
161
-        if (! is_pluralizable($result)) {
161
+        if (!is_pluralizable($result)) {
162 162
             return $result;
163 163
         }
164 164
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
     }
205 205
 }
206 206
 
207
-if (! function_exists('singularize')) {
207
+if (!function_exists('singularize')) {
208 208
     /**
209 209
      * Return $word in singular form.
210 210
      *
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     }
219 219
 }
220 220
 
221
-if (! function_exists('tableize')) {
221
+if (!function_exists('tableize')) {
222 222
     /**
223 223
      * Returns corresponding table name for given model $className. ("people" for the model class "Person").
224 224
      *
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
     }
233 233
 }
234 234
 
235
-if (! function_exists('underscore')) {
235
+if (!function_exists('underscore')) {
236 236
     /**
237 237
      * Underscore
238 238
      *
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     }
247 247
 }
248 248
 
249
-if (! function_exists('variable')) {
249
+if (!function_exists('variable')) {
250 250
     /**
251 251
      * Returns camelBacked version of an underscored string.
252 252
      *
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
     }
261 261
 }
262 262
 
263
-if (! function_exists('counted')) {
263
+if (!function_exists('counted')) {
264 264
     /**
265 265
      * Counted
266 266
      *
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
     }
279 279
 }
280 280
 
281
-if (! function_exists('pascalize')) {
281
+if (!function_exists('pascalize')) {
282 282
     /**
283 283
      * Pascalize
284 284
      *
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
     }
295 295
 }
296 296
 
297
-if (! function_exists('is_pluralizable')) {
297
+if (!function_exists('is_pluralizable')) {
298 298
     /**
299 299
      * Checks if the given word has a plural version.
300 300
      *
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
      */
303 303
     function is_pluralizable(string $word): bool
304 304
     {
305
-        return ! in_array(
305
+        return !in_array(
306 306
             strtolower($word),
307 307
             [
308 308
                 'advice',
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
     }
378 378
 }
379 379
 
380
-if (! function_exists('ordinal')) {
380
+if (!function_exists('ordinal')) {
381 381
     /**
382 382
      * Returns the suffix that should be added to a
383 383
      * number to denote the position in an ordered
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
     }
405 405
 }
406 406
 
407
-if (! function_exists('ordinalize')) {
407
+if (!function_exists('ordinalize')) {
408 408
     /**
409 409
      * Turns a number into an ordinal string used
410 410
      * to denote the position in an ordered sequence
Please login to merge, or discard this patch.