Test Failed
Branch main (50345c)
by Dimitri
03:34
created
src/Http/UrlGenerator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
     {
256 256
         $route = $this->routes->reverseRoute($name, ...$parameters);
257 257
 
258
-        if (! $route) {
258
+        if (!$route) {
259 259
             throw HttpException::invalidRedirectRoute($route);
260 260
         }
261 261
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
      */
333 333
     public function isValidUrl(string $path): bool
334 334
     {
335
-        if (! preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) {
335
+        if (!preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) {
336 336
             return filter_var($path, FILTER_VALIDATE_URL) !== false;
337 337
         }
338 338
 
Please login to merge, or discard this patch.
src/Debug/Debugger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
         $debugger = Ignition::make();
63 63
 
64 64
         $debugger->applicationPath(ROOTPATH)
65
-            ->shouldDisplayException(! on_prod())
65
+            ->shouldDisplayException(!on_prod())
66 66
             ->register();
67 67
     }
68 68
 }
Please login to merge, or discard this patch.
src/Helpers/filesystem.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 use BlitzPHP\Container\Services;
13 13
 
14
-if (! function_exists('directory_map')) {
14
+if (!function_exists('directory_map')) {
15 15
     /**
16 16
      * Créer une carte de répertoire
17 17
      *
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     }
30 30
 }
31 31
 
32
-if (! function_exists('directory_mirror')) {
32
+if (!function_exists('directory_mirror')) {
33 33
     /**
34 34
      * Copie récursivement les fichiers et répertoires du répertoire d'origine
35 35
      * dans le répertoire cible, c'est-à-dire "miroir" son contenu.
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     }
43 43
 }
44 44
 
45
-if (! function_exists('write_file')) {
45
+if (!function_exists('write_file')) {
46 46
     /**
47 47
      * Write File
48 48
      *
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     }
77 77
 }
78 78
 
79
-if (! function_exists('delete_files')) {
79
+if (!function_exists('delete_files')) {
80 80
     /**
81 81
      * Delete Files
82 82
      *
@@ -101,18 +101,18 @@  discard block
 block discarded – undo
101 101
                 RecursiveIteratorIterator::CHILD_FIRST
102 102
             ) as $object) {
103 103
                 $filename = $object->getFilename();
104
-                if (! $hidden && $filename[0] === '.') {
104
+                if (!$hidden && $filename[0] === '.') {
105 105
                     continue;
106 106
                 }
107 107
 
108
-                if (! $htdocs || ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) {
108
+                if (!$htdocs || !preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) {
109 109
                     $isDir = $object->isDir();
110 110
                     if ($isDir && $delDir) {
111 111
                         rmdir($object->getPathname());
112 112
 
113 113
                         continue;
114 114
                     }
115
-                    if (! $isDir) {
115
+                    if (!$isDir) {
116 116
                         unlink($object->getPathname());
117 117
                     }
118 118
                 }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     }
126 126
 }
127 127
 
128
-if (! function_exists('get_filenames')) {
128
+if (!function_exists('get_filenames')) {
129 129
     /**
130 130
      * Get Filenames
131 131
      *
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
                 RecursiveIteratorIterator::SELF_FIRST
155 155
             ) as $name => $object) {
156 156
                 $basename = pathinfo($name, PATHINFO_BASENAME);
157
-                if (! $hidden && $basename[0] === '.') {
157
+                if (!$hidden && $basename[0] === '.') {
158 158
                     continue;
159 159
                 }
160 160
 
161
-                if ($includeDir || ! $object->isDir()) {
161
+                if ($includeDir || !$object->isDir()) {
162 162
                     if ($includePath === false) {
163 163
                         $files[] = $basename;
164 164
                     } elseif ($includePath === null) {
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
     }
179 179
 }
180 180
 
181
-if (! function_exists('get_dir_file_info')) {
181
+if (!function_exists('get_dir_file_info')) {
182 182
     /**
183 183
      * Get Directory File Information
184 184
      *
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     }
225 225
 }
226 226
 
227
-if (! function_exists('get_file_info')) {
227
+if (!function_exists('get_file_info')) {
228 228
     /**
229 229
      * Get File Info
230 230
      *
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      */
241 241
     function get_file_info(string $file, $returnedValues = ['name', 'server_path', 'size', 'date'])
242 242
     {
243
-        if (! is_file($file)) {
243
+        if (!is_file($file)) {
244 244
             return null;
245 245
         }
246 246
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     }
291 291
 }
292 292
 
293
-if (! function_exists('symbolic_permissions')) {
293
+if (!function_exists('symbolic_permissions')) {
294 294
     /**
295 295
      * Symbolic Permissions
296 296
      *
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
     }
339 339
 }
340 340
 
341
-if (! function_exists('octal_permissions')) {
341
+if (!function_exists('octal_permissions')) {
342 342
     /**
343 343
      * Octal Permissions
344 344
      *
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
     }
354 354
 }
355 355
 
356
-if (! function_exists('same_file')) {
356
+if (!function_exists('same_file')) {
357 357
     /**
358 358
      * Checks if two files both exist and have identical hashes
359 359
      *
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     }
366 366
 }
367 367
 
368
-if (! function_exists('set_realpath')) {
368
+if (!function_exists('set_realpath')) {
369 369
     /**
370 370
      * Set Realpath
371 371
      *
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
         // Resolve the path
382 382
         if (realpath($path) !== false) {
383 383
             $path = realpath($path);
384
-        } elseif ($checkExistence && ! is_dir($path) && ! is_file($path)) {
384
+        } elseif ($checkExistence && !is_dir($path) && !is_file($path)) {
385 385
             throw new InvalidArgumentException('Not a valid path: ' . $path);
386 386
         }
387 387
 
Please login to merge, or discard this patch.
src/Container/Container.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function addIf(string $key, Closure $callback): void
110 110
     {
111
-        if (! $this->has($key)) {
111
+        if (!$this->has($key)) {
112 112
             $this->add($key, $callback);
113 113
         }
114 114
     }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
      */
225 225
     private function discoveProviders(): void
226 226
     {
227
-        if (! self::$discovered) {
227
+        if (!self::$discovered) {
228 228
             $locator = Services::locator();
229 229
             $files   = array_merge(
230 230
                 $locator->search('Config/Providers'),
Please login to merge, or discard this patch.
src/Config/Config.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public function exists(string $key): bool
57 57
     {
58
-        if (! $this->configurator->exists($key)) {
58
+        if (!$this->configurator->exists($key)) {
59 59
             $config = explode('.', $key);
60 60
             $this->load($config[0]);
61 61
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function missing(string $key): bool
80 80
     {
81
-        return ! $this->exists($key);
81
+        return !$this->exists($key);
82 82
     }
83 83
 
84 84
     /**
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     {
121 121
         if (is_array($config)) {
122 122
             foreach ($config as $key => $value) {
123
-                if (! is_string($value) || empty($value)) {
123
+                if (!is_string($value) || empty($value)) {
124 124
                     continue;
125 125
                 }
126 126
                 if (is_string($key)) {
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
                 }
133 133
                 self::load($conf, $file);
134 134
             }
135
-        } elseif (is_string($config) && ! isset(self::$loaded[$config])) {
135
+        } elseif (is_string($config) && !isset(self::$loaded[$config])) {
136 136
             if (empty($file)) {
137 137
                 $file = self::path($config);
138 138
             }
139 139
 
140 140
             $configurations = [];
141
-            if (file_exists($file) && ! in_array($file, get_included_files(), true)) {
141
+            if (file_exists($file) && !in_array($file, get_included_files(), true)) {
142 142
                 $configurations = (array) require $file;
143 143
             }
144 144
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     {
166 166
         if (is_array($accepts_values)) {
167 167
             $accepts_values = '(Accept values: ' . implode('/', $accepts_values) . ')';
168
-        } elseif (! is_string($accepts_values)) {
168
+        } elseif (!is_string($accepts_values)) {
169 169
             throw new InvalidArgumentException('Misuse of the method ' . __METHOD__);
170 170
         }
171 171
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             $schema = require $app_schema;
208 208
         }
209 209
 
210
-        if (empty($schema) || ! ($schema instanceof Schema)) {
210
+        if (empty($schema) || !($schema instanceof Schema)) {
211 211
             $schema = Expect::mixed();
212 212
         }
213 213
 
@@ -249,14 +249,14 @@  discard block
 block discarded – undo
249 249
 
250 250
         foreach ($registrarsFiles as $file) {
251 251
             $class   = new ReflectionClass($locator->getClassname($file));
252
-            $methods = $class->getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_PUBLIC);
252
+            $methods = $class->getMethods(ReflectionMethod::IS_STATIC|ReflectionMethod::IS_PUBLIC);
253 253
 
254 254
             foreach ($methods as $method) {
255
-                if (! ($method->isPublic() && $method->isStatic())) {
255
+                if (!($method->isPublic() && $method->isStatic())) {
256 256
                     continue;
257 257
                 }
258 258
 
259
-                if (! is_array($result = $method->invoke(null))) {
259
+                if (!is_array($result = $method->invoke(null))) {
260 260
                     continue;
261 261
                 }
262 262
 
@@ -325,12 +325,12 @@  discard block
 block discarded – undo
325 325
     {
326 326
         $config = $this->get('app.show_debugbar', 'auto');
327 327
 
328
-        if (! in_array($config, ['auto', true, false], true)) {
328
+        if (!in_array($config, ['auto', true, false], true)) {
329 329
             self::exceptBadConfigValue('show_debugbar', ['auto', true, false], 'app');
330 330
         }
331 331
 
332 332
         if ($config === 'auto') {
333
-            $this->set('app.show_debugbar', ! is_online());
333
+            $this->set('app.show_debugbar', !is_online());
334 334
         }
335 335
     }
336 336
 }
Please login to merge, or discard this patch.
src/Initializer/bootstrap.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
 defined('DS') || define('DS', DIRECTORY_SEPARATOR);
17 17
 
18 18
 // Se rassurer que le dossier courant pointe sur le dossier du front controller
19
-if (! defined('TEST_PATH')) {
19
+if (!defined('TEST_PATH')) {
20 20
     // On doit aussi verifier qu'on n'est pas en phase de test, sinon khalan ne trouvera pas le dossier des specs
21 21
     chdir(WEBROOT);
22 22
 }
23 23
 
24
-return function (array $paths, string $paths_config_file, bool $is_cli) {
24
+return function(array $paths, string $paths_config_file, bool $is_cli) {
25 25
     // Le chemin d'accès vers le dossier de l'application
26 26
     if (is_dir($paths['app'])) {
27 27
         if (($_temp = realpath($paths['app'])) !== false) {
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     require_once __DIR__ . DS . 'kint.php';
103 103
 
104
-    if (! $is_cli) {
104
+    if (!$is_cli) {
105 105
         $app->run();
106 106
     }
107 107
 };
Please login to merge, or discard this patch.
src/Mail/Adapters/PHPMailer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public function __construct(bool $debug = false)
33 33
     {
34 34
         $this->mailer              = new Mailer();
35
-        $this->mailer->Debugoutput = static function ($str, $level) {
35
+        $this->mailer->Debugoutput = static function($str, $level) {
36 36
             Services::logger()->info('[Mail][' . $level . ']: ' . $str);
37 37
         };
38 38
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function init(array $config): self
46 46
     {
47
-        if (! empty($config['username']) && ! empty($config['password'])) {
47
+        if (!empty($config['username']) && !empty($config['password'])) {
48 48
             $this->mailer->SMTPAuth = true;
49 49
         }
50 50
 
Please login to merge, or discard this patch.
src/Debug/Toolbar.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $this->config = $config ?? (object) config('toolbar');
68 68
 
69 69
         foreach ($this->config->collectors as $collector) {
70
-            if (! class_exists($collector)) {
70
+            if (!class_exists($collector)) {
71 71
                 logger()->critical(
72 72
                     'Toolbar collector does not exist (' . $collector . ').'
73 73
                     . ' Please check $collectors in the app/Config/toolbar.php file.'
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             $data['vars']['varData'][esc($heading)] = $varData;
134 134
         }
135 135
 
136
-        if (! empty($_SESSION)) {
136
+        if (!empty($_SESSION)) {
137 137
             foreach ($_SESSION as $key => $value) {
138 138
                 // Remplacez les données binaires par une chaîne pour éviter l'échec de json_encode.
139 139
                 if (is_string($value) && preg_match('~[^\x20-\x7E\t\r\n]~', $value)) {
@@ -206,8 +206,8 @@  discard block
 block discarded – undo
206 206
         $output = '';
207 207
 
208 208
         foreach ($rows as $row) {
209
-            $hasChildren = isset($row['children']) && ! empty($row['children']);
210
-            $isQuery     = isset($row['query']) && ! empty($row['query']);
209
+            $hasChildren = isset($row['children']) && !empty($row['children']);
210
+            $isQuery     = isset($row['query']) && !empty($row['query']);
211 211
 
212 212
             // Ouvrir la chronologie du contrôleur par défaut
213 213
             $open = $row['name'] === 'Controller';
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
         // Le collecter
274 274
         foreach ($collectors as $collector) {
275
-            if (! $collector['hasTimelineData']) {
275
+            if (!$collector['hasTimelineData']) {
276 276
                 continue;
277 277
             }
278 278
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
         array_multisort(...$sortArray);
290 290
 
291 291
         // Ajouter une heure de fin à chaque élément
292
-        array_walk($data, static function (&$row) {
292
+        array_walk($data, static function(&$row) {
293 293
             $row['end'] = $row['start'] + $row['duration'];
294 294
         });
295 295
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
         $element = array_shift($elements);
309 309
 
310 310
         // Si nous avons des enfants derrière nous, récupérez-les et attachez-les-nous
311
-        while (! empty($elements) && $elements[array_key_first($elements)]['end'] <= $element['end']) {
311
+        while (!empty($elements) && $elements[array_key_first($elements)]['end'] <= $element['end']) {
312 312
             $element['children'][] = array_shift($elements);
313 313
         }
314 314
 
@@ -332,14 +332,14 @@  discard block
 block discarded – undo
332 332
      */
333 333
     protected function collectVarData(): array
334 334
     {
335
-        if (! ($this->config->collectVarData ?? true)) {
335
+        if (!($this->config->collectVarData ?? true)) {
336 336
             return [];
337 337
         }
338 338
 
339 339
         $data = [];
340 340
 
341 341
         foreach ($this->collectors as $collector) {
342
-            if (! $collector->hasVarData()) {
342
+            if (!$collector->hasVarData()) {
343 343
                 continue;
344 344
             }
345 345
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
         }
375 375
 
376 376
         // Si on a desactiver le debogage ou l'affichage de la debugbar, on s'arrete
377
-        if (! BLITZ_DEBUG || ! $this->config->show_debugbar) {
377
+        if (!BLITZ_DEBUG || !$this->config->show_debugbar) {
378 378
             return $response;
379 379
         }
380 380
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
         // Mise à jour vers microtime() pour que nous puissions obtenir l'historique
390 390
         $time = sprintf('%.6f', Date::now()->format('U.u'));
391 391
 
392
-        if (! is_dir($this->debugPath)) {
392
+        if (!is_dir($this->debugPath)) {
393 393
             mkdir($this->debugPath, 0o777);
394 394
         }
395 395
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 
400 400
         // Les formats non HTML ne doivent pas inclure la barre de débogage,
401 401
         // puis nous envoyons des en-têtes indiquant où trouver les données de débogage pour cette réponse
402
-        if ($request->ajax() || ! str_contains($format, 'html')) {
402
+        if ($request->ajax() || !str_contains($format, 'html')) {
403 403
             return $response
404 404
                 ->withHeader('Debugbar-Time', "{$time}")
405 405
                 ->withHeader('Debugbar-Link', site_url("?debugbar_time={$time}"));
Please login to merge, or discard this patch.
src/Debug/ExceptionManager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public static function registerHttpErrors(Run $debugger, array $config): Run
37 37
     {
38
-        return $debugger->pushHandler(static function (Throwable $exception, InspectorInterface $inspector, RunInterface $run) use ($config) {
38
+        return $debugger->pushHandler(static function(Throwable $exception, InspectorInterface $inspector, RunInterface $run) use ($config) {
39 39
             if (true === $config['log']) {
40
-                if (! in_array($exception->getCode(), $config['ignore_codes'], true)) {
40
+                if (!in_array($exception->getCode(), $config['ignore_codes'], true)) {
41 41
                     Services::logger()->error($exception);
42 42
                 }
43 43
             }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             $debugger->pushHandler(new PlainTextHandler());
87 87
         }
88 88
 
89
-        if (! is_online()) {
89
+        if (!is_online()) {
90 90
             if (Misc::isAjaxRequest()) {
91 91
                 $debugger->pushHandler(new JsonResponseHandler());
92 92
             } else {
Please login to merge, or discard this patch.