Test Failed
Push — main ( 94eef3...96fa17 )
by Dimitri
14:06
created
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
      *
@@ -100,30 +100,30 @@  discard block
 block discarded – undo
100 100
     {
101 101
         $result = (string) $str;
102 102
 
103
-        if (! is_countable($result)) {
103
+        if (!is_countable($result)) {
104 104
             return $result;
105 105
         }
106 106
 
107 107
         $plural_rules = [
108
-            '/(quiz)$/'               => '\1zes',      // quizzes
109
-            '/^(ox)$/'                => '\1\2en',     // ox
110
-            '/([m|l])ouse$/'          => '\1ice',      // mouse, louse
111
-            '/(matr|vert|ind)ix|ex$/' => '\1ices',     // matrix, vertex, index
112
-            '/(x|ch|ss|sh)$/'         => '\1es',       // search, switch, fix, box, process, address
113
-            '/([^aeiouy]|qu)y$/'      => '\1ies',      // query, ability, agency
114
-            '/(hive)$/'               => '\1s',        // archive, hive
115
-            '/(?:([^f])fe|([lr])f)$/' => '\1\2ves',    // half, safe, wife
116
-            '/sis$/'                  => 'ses',        // basis, diagnosis
117
-            '/([ti])um$/'             => '\1a',        // datum, medium
118
-            '/(p)erson$/'             => '\1eople',    // person, salesperson
119
-            '/(m)an$/'                => '\1en',       // man, woman, spokesman
120
-            '/(c)hild$/'              => '\1hildren',  // child
121
-            '/(buffal|tomat)o$/'      => '\1\2oes',    // buffalo, tomato
122
-            '/(bu|campu)s$/'          => '\1\2ses',    // bus, campus
123
-            '/(alias|status|virus)$/' => '\1es',       // alias
124
-            '/(octop)us$/'            => '\1i',        // octopus
125
-            '/(ax|cris|test)is$/'     => '\1es',       // axis, crisis
126
-            '/s$/'                    => 's',          // no change (compatibility)
108
+            '/(quiz)$/'               => '\1zes', // quizzes
109
+            '/^(ox)$/'                => '\1\2en', // ox
110
+            '/([m|l])ouse$/'          => '\1ice', // mouse, louse
111
+            '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index
112
+            '/(x|ch|ss|sh)$/'         => '\1es', // search, switch, fix, box, process, address
113
+            '/([^aeiouy]|qu)y$/'      => '\1ies', // query, ability, agency
114
+            '/(hive)$/'               => '\1s', // archive, hive
115
+            '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife
116
+            '/sis$/'                  => 'ses', // basis, diagnosis
117
+            '/([ti])um$/'             => '\1a', // datum, medium
118
+            '/(p)erson$/'             => '\1eople', // person, salesperson
119
+            '/(m)an$/'                => '\1en', // man, woman, spokesman
120
+            '/(c)hild$/'              => '\1hildren', // child
121
+            '/(buffal|tomat)o$/'      => '\1\2oes', // buffalo, tomato
122
+            '/(bu|campu)s$/'          => '\1\2ses', // bus, campus
123
+            '/(alias|status|virus)$/' => '\1es', // alias
124
+            '/(octop)us$/'            => '\1i', // octopus
125
+            '/(ax|cris|test)is$/'     => '\1es', // axis, crisis
126
+            '/s$/'                    => 's', // no change (compatibility)
127 127
             '/$/'                     => 's',
128 128
         ];
129 129
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     }
139 139
 }
140 140
 
141
-if (! function_exists('pluralize')) {
141
+if (!function_exists('pluralize')) {
142 142
     /**
143 143
      * Return $word in plural form.
144 144
      *
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     }
153 153
 }
154 154
 
155
-if (! function_exists('singular')) {
155
+if (!function_exists('singular')) {
156 156
     /**
157 157
      * Singular
158 158
      *
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     {
167 167
         $result = (string) $str;
168 168
 
169
-        if (! is_countable($result)) {
169
+        if (!is_countable($result)) {
170 170
             return $result;
171 171
         }
172 172
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     }
213 213
 }
214 214
 
215
-if (! function_exists('singularize')) {
215
+if (!function_exists('singularize')) {
216 216
     /**
217 217
      * Return $word in singular form.
218 218
      *
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     }
227 227
 }
228 228
 
229
-if (! function_exists('tableize')) {
229
+if (!function_exists('tableize')) {
230 230
     /**
231 231
      * Returns corresponding table name for given model $className. ("people" for the model class "Person").
232 232
      *
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
     }
241 241
 }
242 242
 
243
-if (! function_exists('underscore')) {
243
+if (!function_exists('underscore')) {
244 244
     /**
245 245
      * Underscore
246 246
      *
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     }
255 255
 }
256 256
 
257
-if (! function_exists('variable')) {
257
+if (!function_exists('variable')) {
258 258
     /**
259 259
      * Returns camelBacked version of an underscored string.
260 260
      *
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     }
269 269
 }
270 270
 
271
-if (! function_exists('counted')) {
271
+if (!function_exists('counted')) {
272 272
     /**
273 273
      * Counted
274 274
      *
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
     }
287 287
 }
288 288
 
289
-if (! function_exists('pascalize')) {
289
+if (!function_exists('pascalize')) {
290 290
     /**
291 291
      * Pascalize
292 292
      *
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
     }
303 303
 }
304 304
 
305
-if (! function_exists('is_pluralizable')) {
305
+if (!function_exists('is_pluralizable')) {
306 306
     /**
307 307
      * Checks if the given word has a plural version.
308 308
      *
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      */
311 311
     function is_pluralizable(string $word): bool
312 312
     {
313
-        return ! in_array(
313
+        return !in_array(
314 314
             strtolower($word),
315 315
             [
316 316
                 'advice',
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
     }
386 386
 }
387 387
 
388
-if (! function_exists('ordinal')) {
388
+if (!function_exists('ordinal')) {
389 389
     /**
390 390
      * Returns the suffix that should be added to a
391 391
      * number to denote the position in an ordered
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
     }
413 413
 }
414 414
 
415
-if (! function_exists('ordinalize')) {
415
+if (!function_exists('ordinalize')) {
416 416
     /**
417 417
      * Turns a number into an ordinal string used
418 418
      * to denote the position in an ordered sequence
Please login to merge, or discard this patch.
src/Debug/Toolbar/Views/toolbar.tpl.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         </span>
43 43
 
44 44
         <?php foreach ($collectors as $c) : ?>
45
-            <?php if (! $c['isEmpty'] && ($c['hasTabContent'] || $c['hasLabel'])) : ?>
45
+            <?php if (!$c['isEmpty'] && ($c['hasTabContent'] || $c['hasLabel'])) : ?>
46 46
                 <span class="blitzphp-label">
47 47
                     <a href="javascript: void(0)" data-tab="blitzphp-<?= $c['key'] ?>">
48 48
                         <img src="<?= $c['icon'] ?>">
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
     <!-- Collector-provided Tabs -->
104 104
     <?php foreach ($collectors as $c) : ?>
105
-        <?php if (! $c['isEmpty']) : ?>
105
+        <?php if (!$c['isEmpty']) : ?>
106 106
             <?php if ($c['hasTabContent']) : ?>
107 107
                 <div id="blitzphp-<?= $c['key'] ?>" class="tab">
108 108
                     <h2><?= $c['title'] ?> <span><?= $c['titleDetails'] ?></span></h2>
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         </a>
150 150
 
151 151
         <?php if (isset($vars['session'])) : ?>
152
-            <?php if (! empty($vars['session'])) : ?>
152
+            <?php if (!empty($vars['session'])) : ?>
153 153
                 <table id="session_table">
154 154
                     <tbody>
155 155
                     <?php foreach ($vars['session'] as $key => $value) : ?>
Please login to merge, or discard this patch.
src/Router/DefinedRouteCollector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     public function collect(bool $reset = true): array
37 37
     {
38
-        if (! $reset && $this->cachedRoutes !== []) {
38
+        if (!$reset && $this->cachedRoutes !== []) {
39 39
             return $this->cachedRoutes;
40 40
         }
41 41
 
Please login to merge, or discard this patch.
src/Helpers/assets.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * the LICENSE file that was distributed with this source code.
10 10
  */
11 11
 
12
-if (! function_exists('css_url')) {
12
+if (!function_exists('css_url')) {
13 13
     /**
14 14
      * CSS URL
15 15
      *
@@ -23,17 +23,17 @@  discard block
 block discarded – undo
23 23
         $name = str_replace(site_url() . 'css/', '', htmlspecialchars($name));
24 24
 
25 25
         if (is_localfile($name)) {
26
-            $name .= (! preg_match('#\.css$#i', $name) ? '.css' : '');
26
+            $name .= (!preg_match('#\.css$#i', $name) ? '.css' : '');
27 27
             $filename = WEBROOT . 'css' . DS . $name;
28 28
 
29 29
             return site_url() . 'css/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : '');
30 30
         }
31 31
 
32
-        return $name . (! preg_match('#\.css$#i', $name) ? '.css' : '');
32
+        return $name . (!preg_match('#\.css$#i', $name) ? '.css' : '');
33 33
     }
34 34
 }
35 35
 
36
-if (! function_exists('js_url')) {
36
+if (!function_exists('js_url')) {
37 37
     /**
38 38
      * JS URL
39 39
      *
@@ -47,17 +47,17 @@  discard block
 block discarded – undo
47 47
         $name = str_replace(site_url() . 'js/', '', htmlspecialchars($name));
48 48
 
49 49
         if (is_localfile($name)) {
50
-            $name .= (! preg_match('#\.js$#i', $name) ? '.js' : '');
50
+            $name .= (!preg_match('#\.js$#i', $name) ? '.js' : '');
51 51
             $filename = WEBROOT . 'js' . DS . $name;
52 52
 
53 53
             return site_url() . 'js/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : '');
54 54
         }
55 55
 
56
-        return $name . (! preg_match('#\.js$#i', $name) ? '.js' : '');
56
+        return $name . (!preg_match('#\.js$#i', $name) ? '.js' : '');
57 57
     }
58 58
 }
59 59
 
60
-if (! function_exists('lib_css_url')) {
60
+if (!function_exists('lib_css_url')) {
61 61
     /**
62 62
      * LIB CSS URL
63 63
      *
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         );
77 77
 
78 78
         if (is_localfile($name)) {
79
-            $name .= (! preg_match('#\.css$#i', $name) ? '.css' : '');
79
+            $name .= (!preg_match('#\.css$#i', $name) ? '.css' : '');
80 80
             $paths = ['lib', 'vendor', 'plugins'];
81 81
 
82 82
             foreach ($paths as $path) {
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
             return $site_url . 'lib/' . $name;
91 91
         }
92 92
 
93
-        return $name . (! preg_match('#\.css$#i', $name) ? '.css' : '');
93
+        return $name . (!preg_match('#\.css$#i', $name) ? '.css' : '');
94 94
     }
95 95
 }
96 96
 
97
-if (! function_exists('lib_js_url')) {
97
+if (!function_exists('lib_js_url')) {
98 98
     /**
99 99
      * LIB JS URL
100 100
      *
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         );
114 114
 
115 115
         if (is_localfile($name)) {
116
-            $name .= (! preg_match('#\.js$#i', $name) ? '.js' : '');
116
+            $name .= (!preg_match('#\.js$#i', $name) ? '.js' : '');
117 117
             $paths = ['lib', 'vendor', 'plugins'];
118 118
 
119 119
             foreach ($paths as $path) {
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
             return $site_url . 'lib/' . $name;
128 128
         }
129 129
 
130
-        return $name . (! preg_match('#\.js$#i', $name) ? '.js' : '');
130
+        return $name . (!preg_match('#\.js$#i', $name) ? '.js' : '');
131 131
     }
132 132
 }
133 133
 
134
-if (! function_exists('lib_styles')) {
134
+if (!function_exists('lib_styles')) {
135 135
     /**
136 136
      * LIB_STYLES
137 137
      *
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
         foreach ($name as $style) {
151 151
             if (is_string($style)) {
152
-                $style = (! preg_match('#\.css$#i', $style) ? $style . '.css' : $style);
152
+                $style = (!preg_match('#\.css$#i', $style) ? $style . '.css' : $style);
153 153
                 if (is_file(WEBROOT . 'lib' . DS . str_replace('/', DS, $style))) {
154 154
                     $return[] = '<link rel="preload" type="text/css" href="' . lib_css_url($style) . '" as="style">
155 155
 						<link rel="stylesheet" type="text/css" href="' . lib_css_url($style) . '" />';
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
     }
174 174
 }
175 175
 
176
-if (! function_exists('lib_scripts')) {
176
+if (!function_exists('lib_scripts')) {
177 177
     /**
178 178
      * LIB_SCRIPTS
179 179
      *
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
         foreach ($name as $script) {
193 193
             if (is_string($script)) {
194
-                $script = (! preg_match('#\.js$#i', $script) ? $script . '.js' : $script);
194
+                $script = (!preg_match('#\.js$#i', $script) ? $script . '.js' : $script);
195 195
                 if (is_file(WEBROOT . 'lib' . DS . str_replace('/', DS, $script))) {
196 196
                     $return[] = '<script type="text/javascript" src="' . lib_js_url($script) . '"></script>';
197 197
                 } elseif (is_localfile($script)) {
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     }
214 214
 }
215 215
 
216
-if (! function_exists('styles')) {
216
+if (!function_exists('styles')) {
217 217
     /**
218 218
      * STYLES
219 219
      *
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
         foreach ($name as $style) {
233 233
             if (is_string($style)) {
234
-                $style = (! preg_match('#\.css$#i', $style) ? $style . '.css' : $style);
234
+                $style = (!preg_match('#\.css$#i', $style) ? $style . '.css' : $style);
235 235
                 if (is_file(WEBROOT . 'css' . DS . str_replace('/', DS, $style))) {
236 236
                     $return[] = '<link rel="preload" type="text/css" href="' . css_url($style) . '" as="style">
237 237
 						<link rel="stylesheet" type="text/css" href="' . css_url($style) . '" />';
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
     }
256 256
 }
257 257
 
258
-if (! function_exists('scripts')) {
258
+if (!function_exists('scripts')) {
259 259
     /**
260 260
      * SCRIPTS
261 261
      *
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 
274 274
         foreach ($name as $script) {
275 275
             if (is_string($script)) {
276
-                $script = (! preg_match('#\.js$#i', $script) ? $script . '.js' : $script);
276
+                $script = (!preg_match('#\.js$#i', $script) ? $script . '.js' : $script);
277 277
                 if (is_file(WEBROOT . 'js' . DS . str_replace('/', DS, $script))) {
278 278
                     $return[] = '<script type="text/javascript" src="' . js_url($script) . '"></script>';
279 279
                 } elseif (is_localfile($script)) {
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
     }
296 296
 }
297 297
 
298
-if (! function_exists('less_url')) {
298
+if (!function_exists('less_url')) {
299 299
     /**
300 300
      * LESS URL
301 301
      *
@@ -309,17 +309,17 @@  discard block
 block discarded – undo
309 309
         $name = str_replace(site_url() . 'less/', '', htmlspecialchars($name));
310 310
 
311 311
         if (is_localfile($name)) {
312
-            $name .= (! preg_match('#\.less$#i', $name) ? '.less' : '');
312
+            $name .= (!preg_match('#\.less$#i', $name) ? '.less' : '');
313 313
             $filename = WEBROOT . 'less' . DS . $name;
314 314
 
315 315
             return site_url() . 'less/' . $name . ((file_exists($filename)) ? '?v=' . filemtime($filename) : '');
316 316
         }
317 317
 
318
-        return $name . (! preg_match('#\.less$#i', $name) ? '.less' : '');
318
+        return $name . (!preg_match('#\.less$#i', $name) ? '.less' : '');
319 319
     }
320 320
 }
321 321
 
322
-if (! function_exists('less_styles')) {
322
+if (!function_exists('less_styles')) {
323 323
     /**
324 324
      * LESS_STYLES
325 325
      *
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 
338 338
         foreach ($name as $style) {
339 339
             if (is_string($style)) {
340
-                $style = (! preg_match('#\.less$#i', $style) ? $style . '.less' : $style);
340
+                $style = (!preg_match('#\.less$#i', $style) ? $style . '.less' : $style);
341 341
                 if (is_file(WEBROOT . 'less' . DS . str_replace('/', DS, $style))) {
342 342
                     $return[] = '<link rel="stylesheet" type="text/less" href="' . less_url($style) . '" />';
343 343
                 } elseif (is_localfile($style)) {
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
     }
360 360
 }
361 361
 
362
-if (! function_exists('img_url')) {
362
+if (!function_exists('img_url')) {
363 363
     /**
364 364
      * IMG URL
365 365
      *
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     }
387 387
 }
388 388
 
389
-if (! function_exists('img')) {
389
+if (!function_exists('img')) {
390 390
     /**
391 391
      * IMG
392 392
      *
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
     }
418 418
 }
419 419
 
420
-if (! function_exists('docs_url')) {
420
+if (!function_exists('docs_url')) {
421 421
     /**
422 422
      * DOCS URL
423 423
      *
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
     }
445 445
 }
446 446
 
447
-if (! function_exists('videos_url')) {
447
+if (!function_exists('videos_url')) {
448 448
     /**
449 449
      * VIDEOS URL
450 450
      *
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
     }
472 472
 }
473 473
 
474
-if (! function_exists('mix')) {
474
+if (!function_exists('mix')) {
475 475
     /**
476 476
      * Obtenez le chemin d'accès à un fichier Mix versionné.
477 477
      *
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
         if (is_file($publicPath . $manifestDirectory . '/hot')) {
497 497
             $url = rtrim(file_get_contents($publicPath . $manifestDirectory . '/hot'));
498 498
 
499
-            if (! empty($customUrl = $customUrl = $config->hot_proxy_url)) {
499
+            if (!empty($customUrl = $customUrl = $config->hot_proxy_url)) {
500 500
                 return $customUrl . $path;
501 501
             }
502 502
 
@@ -509,8 +509,8 @@  discard block
 block discarded – undo
509 509
 
510 510
         $manifestPath = $publicPath . $manifestDirectory . '/mix-manifest.json';
511 511
 
512
-        if (! isset($manifests[$manifestPath])) {
513
-            if (! is_file($manifestPath)) {
512
+        if (!isset($manifests[$manifestPath])) {
513
+            if (!is_file($manifestPath)) {
514 514
                 throw new Exception('Le manifeste Mix n\'existe pas.');
515 515
             }
516 516
 
@@ -519,10 +519,10 @@  discard block
 block discarded – undo
519 519
 
520 520
         $manifest = $manifests[$manifestPath];
521 521
 
522
-        if (! isset($manifest[$path])) {
522
+        if (!isset($manifest[$path])) {
523 523
             $exception = new Exception("Impossible de localiser le fichier Mix: {$path}.");
524 524
 
525
-            if (! BLITZ_DEBUG) {
525
+            if (!BLITZ_DEBUG) {
526 526
                 return $path;
527 527
             }
528 528
 
Please login to merge, or discard this patch.
src/Controllers/ApplicationController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $path = '';
44 44
 
45 45
         // N'est-il pas namespaced ? on cherche le dossier en fonction du controleur
46
-        if (! str_contains($view, '\\')) {
46
+        if (!str_contains($view, '\\')) {
47 47
             $reflection                                      = new ReflectionClass(static::class);
48 48
             ['dirname' => $dirname, 'filename' => $filename] = pathinfo($reflection->getFileName());
49 49
             $dirname                                         = str_ireplace('Controllers', 'Views', $dirname);
@@ -55,15 +55,15 @@  discard block
 block discarded – undo
55 55
 
56 56
         $viewer->setData($data)->setOptions($options);
57 57
 
58
-        if (! empty($this->layout) && is_string($this->layout)) {
58
+        if (!empty($this->layout) && is_string($this->layout)) {
59 59
             $viewer->setLayout($this->layout);
60 60
         }
61 61
 
62
-        if (! empty($this->viewDatas) && is_array($this->viewDatas)) {
62
+        if (!empty($this->viewDatas) && is_array($this->viewDatas)) {
63 63
             $viewer->addData($this->viewDatas);
64 64
         }
65 65
 
66
-        if (! is_string($controllerName = Dispatcher::getController(false))) {
66
+        if (!is_string($controllerName = Dispatcher::getController(false))) {
67 67
             $controllerName = static::class;
68 68
         }
69 69
 
Please login to merge, or discard this patch.
src/Controllers/RestController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $this->config = (object) config('rest');
73 73
 
74 74
         $locale       = $this->config->language ?? null;
75
-        $this->locale = ! empty($locale) ? $locale : $this->request->getLocale();
75
+        $this->locale = !empty($locale) ? $locale : $this->request->getLocale();
76 76
     }
77 77
 
78 78
     public function _remap(string $method, array $params = [])
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $class = static::class;
81 81
 
82 82
         // Bien sûr qu'il existe, mais peuvent-ils en faire quelque chose ?
83
-        if (! method_exists($class, $method)) {
83
+        if (!method_exists($class, $method)) {
84 84
             return $this->respondNotImplemented($this->_translate('notImplemented', [$class, $method]));
85 85
         }
86 86
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
             return $this->respondOk($response);
109 109
         } catch (Throwable $ex) {
110
-            if (! on_dev()) {
110
+            if (!on_dev()) {
111 111
                 $url = explode('?', $this->request->getRequestTarget())[0];
112 112
 
113 113
                 return $this->respondBadRequest($this->_translate('badUsed', [$url]));
@@ -156,18 +156,18 @@  discard block
 block discarded – undo
156 156
     final protected function respondFail(?string $message = "Une erreur s'est produite", ?int $status = StatusCode::INTERNAL_ERROR, null|int|string $code = null, array $errors = [])
157 157
     {
158 158
         $message = $message ?: "Une erreur s'est produite";
159
-        $code    = ! empty($code) ? $code : $status;
159
+        $code    = !empty($code) ? $code : $status;
160 160
 
161 161
         $response = [
162 162
             $this->config->field['message'] ?? 'message' => $message,
163 163
         ];
164
-        if (! empty($this->config->field['status'])) {
164
+        if (!empty($this->config->field['status'])) {
165 165
             $response[$this->config->field['status']] = false;
166 166
         }
167
-        if (! empty($this->config->field['code'])) {
167
+        if (!empty($this->config->field['code'])) {
168 168
             $response[$this->config->field['code']] = $code;
169 169
         }
170
-        if (! empty($errors)) {
170
+        if (!empty($errors)) {
171 171
             $response[$this->config->field['errors'] ?? 'errors'] = $errors;
172 172
         }
173 173
 
@@ -188,12 +188,12 @@  discard block
 block discarded – undo
188 188
     final protected function respondSuccess(?string $message = 'Resultat', $result = null, ?int $status = StatusCode::OK)
189 189
     {
190 190
         $message = $message ?: 'Resultat';
191
-        $status  = ! empty($status) ? $status : StatusCode::OK;
191
+        $status  = !empty($status) ? $status : StatusCode::OK;
192 192
 
193 193
         $response = [
194 194
             $this->config->field['message'] ?? 'message' => $message,
195 195
         ];
196
-        if (! empty($this->config->field['status'])) {
196
+        if (!empty($this->config->field['status'])) {
197 197
             $response[$this->config->field['status']] = true;
198 198
         }
199 199
         if (is_array($result)) {
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
      */
309 309
     final protected function allowedMethods(string ...$methods): self
310 310
     {
311
-        if (! empty($methods)) {
311
+        if (!empty($methods)) {
312 312
             $this->config->allowed_methods = array_map(static fn ($str) => strtoupper($str), $methods);
313 313
         }
314 314
 
@@ -406,13 +406,13 @@  discard block
 block discarded – undo
406 406
         }
407 407
 
408 408
         // Si la méthode de format existe, appelle et renvoie la sortie dans ce format
409
-        if (! empty($mime)) {
409
+        if (!empty($mime)) {
410 410
             $output = Formatter::type($mime)->format($data);
411 411
 
412 412
             // Définit l'en-tête du format
413 413
             // Ensuite, vérifiez si le client a demandé un rappel, et si la sortie contient ce rappel :
414 414
             $callback = $this->request->getQuery('callback');
415
-            if (! empty($callback) && $mime === $this->mimes['json'] && preg_match('/^' . $callback . '/', $output)) {
415
+            if (!empty($callback) && $mime === $this->mimes['json'] && preg_match('/^' . $callback . '/', $output)) {
416 416
                 $this->response = $this->response->withType($this->mimes['jsonp']);
417 417
             } else {
418 418
                 $this->response = $this->response->withType($mime === $this->mimes['array'] ? $this->mimes['json'] : $mime);
@@ -468,22 +468,22 @@  discard block
 block discarded – undo
468 468
     private function checkProcess(): bool|ResponseInterface
469 469
     {
470 470
         // Verifie si la requete est en ajax
471
-        if (! $this->request->is('ajax') && $this->config->ajax_only) {
471
+        if (!$this->request->is('ajax') && $this->config->ajax_only) {
472 472
             return $this->respondNotAcceptable($this->_translate('ajaxOnly'));
473 473
         }
474 474
 
475 475
         // Verifie si la requete est en https
476
-        if (! $this->request->is('https') && $this->config->force_https) {
476
+        if (!$this->request->is('https') && $this->config->force_https) {
477 477
             return $this->respondForbidden($this->_translate('unsupported'));
478 478
         }
479 479
 
480 480
         // Verifie si la methode utilisee pour la requete est autorisee
481
-        if (! in_array(strtoupper($this->request->getMethod()), $this->config->allowed_methods, true)) {
481
+        if (!in_array(strtoupper($this->request->getMethod()), $this->config->allowed_methods, true)) {
482 482
             return $this->respondNotAcceptable($this->_translate('unknownMethod'));
483 483
         }
484 484
 
485 485
         // Verifie que l'ip qui emet la requete n'est pas dans la blacklist
486
-        if (! empty($this->config->ip_blacklis)) {
486
+        if (!empty($this->config->ip_blacklis)) {
487 487
             $this->config->ip_blacklist = implode(',', $this->config->ip_blacklist);
488 488
 
489 489
             // Correspond à une adresse IP dans une liste noire, par ex. 127.0.0.0, 0.0.0.0
@@ -496,20 +496,20 @@  discard block
 block discarded – undo
496 496
         }
497 497
 
498 498
         // Verifie que l'ip qui emet la requete est dans la whitelist
499
-        if (! empty($this->config->ip_whitelist)) {
499
+        if (!empty($this->config->ip_whitelist)) {
500 500
             $whitelist = $this->config->ip_whitelist;
501 501
             array_push($whitelist, '127.0.0.1', '0.0.0.0');
502 502
 
503 503
             // coupez les espaces de début et de fin des ip
504 504
             $whitelist = array_map('trim', $whitelist);
505 505
 
506
-            if (! in_array($this->request->clientIp(), $whitelist, true)) {
506
+            if (!in_array($this->request->clientIp(), $whitelist, true)) {
507 507
                 return $this->respondUnauthorized($this->_translate('ipUnauthorized'));
508 508
             }
509 509
         }
510 510
 
511 511
         // Verifie l'authentification du client
512
-        if (false !== $this->config->auth && ! $this->request->is('options')) {
512
+        if (false !== $this->config->auth && !$this->request->is('options')) {
513 513
             if ('bearer' === strtolower($this->config->auth)) {
514 514
                 $token = $this->getBearerToken();
515 515
                 if (empty($token)) {
Please login to merge, or discard this patch.
src/Event/EventDiscover.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         foreach ($files as $file) {
36 36
             $className = $this->locator->getClassname($file);
37 37
 
38
-            if ($className === '' || ! class_exists($className) || ! is_a($className, EventListenerInterface::class, true)) {
38
+            if ($className === '' || !class_exists($className) || !is_a($className, EventListenerInterface::class, true)) {
39 39
                 continue;
40 40
             }
41 41
 
Please login to merge, or discard this patch.
src/Cli/Traits/GeneratorTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             // @codeCoverageIgnoreStart
121 121
             $this->colorize(lang('CLI.generator.usingBlitzNamespace'), 'yellow');
122 122
 
123
-            if (! $this->confirm('Are you sure you want to continue?')) {
123
+            if (!$this->confirm('Are you sure you want to continue?')) {
124 124
                 $this->eol()->colorize(lang('CLI.generator.cancelOperation'), 'yellow');
125 125
 
126 126
                 return;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
         // Écraser des fichiers sans le savoir est une gêne sérieuse, nous allons donc vérifier si nous dupliquons des choses,
136 136
         // si l'option "forcer" n'est pas fournie, nous renvoyons.
137
-        if (! $this->option('force') && $isFile) {
137
+        if (!$this->option('force') && $isFile) {
138 138
             $this->io->error(lang('CLI.generator.fileExist', [clean_path($target)]), true);
139 139
 
140 140
             return;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         // Vérifie si le répertoire pour enregistrer le fichier existe.
144 144
         $dir = dirname($target);
145 145
 
146
-        if (! is_dir($dir)) {
146
+        if (!is_dir($dir)) {
147 147
             mkdir($dir, 0o755, true);
148 148
         }
149 149
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         // Construisez la classe en fonction des détails dont nous disposons.
153 153
         // Nous obtiendrons le contenu de notre fichier à partir du modèle,
154 154
         // puis nous effectuerons les remplacements nécessaires.
155
-        if (! write_file($target, $content)) {
155
+        if (!write_file($target, $content)) {
156 156
             // @codeCoverageIgnoreStart
157 157
             $this->io->error(lang('CLI.generator.fileError', [clean_path($target)]), true);
158 158
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
             $class = $matches[1] . ucfirst($matches[2]);
227 227
         }
228 228
 
229
-        if ($this->enabledSuffixing && $this->getOption('suffix') && ! strripos($class, $component)) {
229
+        if ($this->enabledSuffixing && $this->getOption('suffix') && !strripos($class, $component)) {
230 230
             $class .= ucfirst($component);
231 231
         }
232 232
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 
298 298
         $base = Services::autoloader()->getNamespace($namespace);
299 299
 
300
-        if (! $base = reset($base)) {
300
+        if (!$base = reset($base)) {
301 301
             $this->io->error(lang('CLI.namespaceNotDefined', [$namespace]), true);
302 302
 
303 303
             return '';
Please login to merge, or discard this patch.
src/Cli/Traits/ContentReplacer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,14 +66,14 @@
 block discarded – undo
66 66
 
67 67
         $directory = dirname($path);
68 68
 
69
-        if (! is_dir($directory)) {
69
+        if (!is_dir($directory)) {
70 70
             mkdir($directory, 0o777, true);
71 71
         }
72 72
 
73 73
         if (file_exists($path)) {
74 74
             $overwrite = (bool) $this->option('f');
75 75
 
76
-            if (! $overwrite && ! $this->confirm("Le fichier '{$cleanPath}' existe déjà dans la destination. Le remplacé?")) {
76
+            if (!$overwrite && !$this->confirm("Le fichier '{$cleanPath}' existe déjà dans la destination. Le remplacé?")) {
77 77
                 $this->error("{$cleanPath} sauté. Si vous souhaitez le remplacer, s'il vous plaît utiliser l'option '-f' ou répondre 'y' à l'invite.")->eol();
78 78
 
79 79
                 return;
Please login to merge, or discard this patch.