Test Failed
Push — main ( 658636...debfee )
by Dimitri
24:40 queued 19:12
created
src/Security/Hashing/Hasher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
             throw HashingException::noDriverRequested();
115 115
         }
116 116
 
117
-        if (! in_array($this->driver, $this->drivers, true)) {
117
+        if (!in_array($this->driver, $this->drivers, true)) {
118 118
             throw HashingException::unKnownHandler($this->driver);
119 119
         }
120 120
 
Please login to merge, or discard this patch.
src/Security/Hashing/Handlers/Argon2IdHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             return false;
32 32
         }
33 33
 
34
-        if ($this->verifyAlgorithm && ! $this->isUsingCorrectAlgorithm($hashedValue)) {
34
+        if ($this->verifyAlgorithm && !$this->isUsingCorrectAlgorithm($hashedValue)) {
35 35
             throw new RuntimeException("Ce mot de passe n'utilise pas l'algorithme Argon2id.");
36 36
         }
37 37
 
Please login to merge, or discard this patch.
src/Security/Hashing/Handlers/ArgonHandler.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             return false;
93 93
         }
94 94
 
95
-        if ($this->verifyAlgorithm && ! $this->isUsingCorrectAlgorithm($hashedValue)) {
95
+        if ($this->verifyAlgorithm && !$this->isUsingCorrectAlgorithm($hashedValue)) {
96 96
             throw new RuntimeException("Ce mot de passe n'utilise pas l'algorithme Argon2i.");
97 97
         }
98 98
 
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
         ['options' => $options] = $this->info($hashedValue);
138 138
 
139 139
         if (
140
-            ! is_int($options['memory_cost'] ?? null)
141
-            || ! is_int($options['time_cost'] ?? null)
142
-            || ! is_int($options['threads'] ?? null)
140
+            !is_int($options['memory_cost'] ?? null)
141
+            || !is_int($options['time_cost'] ?? null)
142
+            || !is_int($options['threads'] ?? null)
143 143
         ) {
144 144
             return false;
145 145
         }
146 146
 
147
-        return ! (
147
+        return !(
148 148
             $options['memory_cost'] > $this->memory
149 149
             || $options['time_cost'] > $this->time
150 150
             || $options['threads'] > $this->threads
Please login to merge, or discard this patch.
src/Security/Hashing/Handlers/BcryptHandler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             return false;
71 71
         }
72 72
 
73
-        if ($this->verifyAlgorithm && ! $this->isUsingCorrectAlgorithm($hashedValue)) {
73
+        if ($this->verifyAlgorithm && !$this->isUsingCorrectAlgorithm($hashedValue)) {
74 74
             throw new RuntimeException("Ce mot de passe n'utilise pas l'algorithme Bcrypt.");
75 75
         }
76 76
 
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
     {
113 113
         ['options' => $options] = $this->info($hashedValue);
114 114
 
115
-        if (! is_int($options['cost'] ?? null)) {
115
+        if (!is_int($options['cost'] ?? null)) {
116 116
             return false;
117 117
         }
118 118
 
119
-        return ! ($options['cost'] > $this->rounds);
119
+        return !($options['cost'] > $this->rounds);
120 120
     }
121 121
 
122 122
     /**
Please login to merge, or discard this patch.
src/Security/Encryption/Encryption.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
             'Sodium' => extension_loaded('sodium') && version_compare(SODIUM_LIBRARY_VERSION, '1.0.14', '>='),
83 83
         ];
84 84
 
85
-        if (! in_array($this->driver, $this->drivers, true) || (array_key_exists($this->driver, $this->handlers) && ! $this->handlers[$this->driver])) {
85
+        if (!in_array($this->driver, $this->drivers, true) || (array_key_exists($this->driver, $this->handlers) && !$this->handlers[$this->driver])) {
86 86
             throw EncryptionException::noHandlerAvailable($this->driver);
87 87
         }
88 88
     }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     public function decrypt(string $data, array|string|null $params = null): string
102 102
     {
103 103
         if (function_exists('mb_check_encoding')) {
104
-            $data = ! mb_check_encoding($data, 'UTF-8') ? $data : base64_decode($data, true);
104
+            $data = !mb_check_encoding($data, 'UTF-8') ? $data : base64_decode($data, true);
105 105
         }
106 106
 
107 107
         return $this->encrypter()->decrypt($data, $params);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             throw EncryptionException::noDriverRequested();
133 133
         }
134 134
 
135
-        if (! in_array($this->driver, $this->drivers, true)) {
135
+        if (!in_array($this->driver, $this->drivers, true)) {
136 136
             throw EncryptionException::unKnownHandler($this->driver);
137 137
         }
138 138
 
Please login to merge, or discard this patch.
src/View/Adapters/AbstractAdapter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -254,18 +254,18 @@
 block discarded – undo
254 254
         $ext ??= $this->ext;
255 255
 
256 256
         $viewPath = $options['viewPath'] ?? $this->viewPath;
257
-        $file     = ! empty($viewPath) ? str_replace('/', DS, rtrim($viewPath, '/\\') . DS . ltrim($view, '/\\')) : $view;
257
+        $file     = !empty($viewPath) ? str_replace('/', DS, rtrim($viewPath, '/\\') . DS . ltrim($view, '/\\')) : $view;
258 258
 
259 259
         $file = Helpers::ensureExt($file, $ext);
260 260
 
261
-        if (! is_file($file)) {
261
+        if (!is_file($file)) {
262 262
             $file = $this->locator->locateFile($view, 'Views', $ext);
263 263
         }
264 264
 
265 265
         $file = realpath($file);
266 266
 
267 267
         // locateFile renverra une chaîne vide si le fichier est introuvable.
268
-        if (! is_file($file)) {
268
+        if (!is_file($file)) {
269 269
             throw ViewException::invalidFile($view);
270 270
         }
271 271
 
Please login to merge, or discard this patch.
src/Cli/Commands/Routes/Routes.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      */
200 200
     protected function getRouteInformation(array $route, SampleURIGenerator $uriGenerator, MiddlewareCollector $middlewareCollector): ?array
201 201
     {
202
-        if (! isset($route['middleware'])) {
202
+        if (!isset($route['middleware'])) {
203 203
             $sampleUri           = $uriGenerator->get($route['route']);
204 204
             $middlewares         = $middlewareCollector->get($route['method'], $sampleUri);
205 205
             $route['middleware'] = implode(' ', array_map(Helpers::classBasename(...), $middlewares));
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
     {
225 225
         if ($route['handler'] instanceof Closure) {
226 226
             $path = (new ReflectionFunction($route['handler']))->getFileName();
227
-        } elseif (is_string($route['handler']) && ! (str_contains($route['handler'], '(View) ') || str_contains($route['handler'], '(Closure) '))) {
228
-            if (! class_exists($classname = explode('::', $route['handler'])[0])) {
227
+        } elseif (is_string($route['handler']) && !(str_contains($route['handler'], '(View) ') || str_contains($route['handler'], '(Closure) '))) {
228
+            if (!class_exists($classname = explode('::', $route['handler'])[0])) {
229 229
                 return false;
230 230
             }
231 231
             $path = (new ReflectionClass($classname))->getFileName();
@@ -241,13 +241,13 @@  discard block
 block discarded – undo
241 241
      */
242 242
     protected function filterRoute(array $route): ?array
243 243
     {
244
-        if (($this->option('name') && ! Text::contains((string) $route['name'], $this->option('name')))
245
-            || ($this->option('handler') && isset($route['handler']) && is_string($route['handler']) && ! Text::contains($route['handler'], $this->option('handler')))
246
-            || ($this->option('path') && ! Text::contains($route['uri'], $this->option('path')))
247
-            || ($this->option('method') && ! Text::contains($route['method'], strtoupper($this->option('method'))))
248
-            || ($this->option('domain') && ! Text::contains((string) $route['domain'], $this->option('domain')))
244
+        if (($this->option('name') && !Text::contains((string) $route['name'], $this->option('name')))
245
+            || ($this->option('handler') && isset($route['handler']) && is_string($route['handler']) && !Text::contains($route['handler'], $this->option('handler')))
246
+            || ($this->option('path') && !Text::contains($route['uri'], $this->option('path')))
247
+            || ($this->option('method') && !Text::contains($route['method'], strtoupper($this->option('method'))))
248
+            || ($this->option('domain') && !Text::contains((string) $route['domain'], $this->option('domain')))
249 249
             || ($this->option('except-vendor') && $route['vendor'])
250
-            || ($this->option('only-vendor') && ! $route['vendor'])) {
250
+            || ($this->option('only-vendor') && !$route['vendor'])) {
251 251
             return null;
252 252
         }
253 253
 
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
         $options = ['sep' => '-', 'second' => ['fg' => Color::GREEN]];
363 363
         $this->justify('Nombre total de routes définies', (string) $total, $options);
364 364
         $this->justify('Nombre de routes affichées', (string) $routes->count(), $options);
365
-        if (! $this->option('method')) {
365
+        if (!$this->option('method')) {
366 366
             $this->border(char: '.');
367 367
             $methods = $routes->map(static fn ($route) => $route['method'])->unique()->sort()->all();
368 368
 
Please login to merge, or discard this patch.
src/Cli/Commands/Encryption/GenerateKey.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
         if (in_array($prefix, [null, true], true)) {
61 61
             $prefix = 'hex2bin';
62
-        } elseif (! in_array($prefix, ['hex2bin', 'base64'], true)) {
62
+        } elseif (!in_array($prefix, ['hex2bin', 'base64'], true)) {
63 63
             $prefix = $this->choice('Veuillez utiliser un prefixe validee.', ['hex2bin', 'base64']); // @codeCoverageIgnore
64 64
         }
65 65
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             return;
80 80
         }
81 81
 
82
-        if (! $this->setNewEncryptionKey($encodedKey)) {
82
+        if (!$this->setNewEncryptionKey($encodedKey)) {
83 83
             $this->writer->error('Erreur dans la configuration d\'une nouvelle clé de chiffrement dans le fichier `.env`.', true);
84 84
 
85 85
             return;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     {
110 110
         $currentKey = env('encryption.key', '');
111 111
 
112
-        if ($currentKey !== '' && ! $this->confirmOverwrite()) {
112
+        if ($currentKey !== '' && !$this->confirmOverwrite()) {
113 113
             // Pas testable car require une entree au clavier
114 114
             return false; // @codeCoverageIgnore
115 115
         }
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
         $baseEnv = ROOTPATH . '.env.example';
134 134
         $envFile = ROOTPATH . '.env';
135 135
 
136
-        if (! is_file($envFile)) {
137
-            if (! is_file($baseEnv)) {
136
+        if (!is_file($envFile)) {
137
+            if (!is_file($baseEnv)) {
138 138
                 $this->writer->warn('Le fichier `.env.example` livré par défaut et le fichier `.env` personnalisé sont manquants.');
139 139
                 $this->eol()->write('Voici votre nouvelle clé à la place: ');
140 140
                 $this->writer->warn($key, true);
Please login to merge, or discard this patch.
src/Debug/Toolbar.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $this->config = $config ?? (object) config('toolbar');
65 65
 
66 66
         foreach ($this->config->collectors as $collector) {
67
-            if (! class_exists($collector)) {
67
+            if (!class_exists($collector)) {
68 68
                 logger()->critical(
69 69
                     'Le collecteur de la barre d\'outils n\'existe pas (' . $collector . ').'
70 70
                     . ' Veuillez vérifier $collectors dans le fichier app/Config/toolbar.php.'
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
         $output = '';
205 205
 
206 206
         foreach ($rows as $row) {
207
-            $hasChildren = isset($row['children']) && ! empty($row['children']);
208
-            $isQuery     = isset($row['query']) && ! empty($row['query']);
207
+            $hasChildren = isset($row['children']) && !empty($row['children']);
208
+            $isQuery     = isset($row['query']) && !empty($row['query']);
209 209
 
210 210
             // Ouvrir la chronologie du contrôleur par défaut
211 211
             $open = $row['name'] === 'Controller';
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 
271 271
         // Le collecter
272 272
         foreach ($collectors as $collector) {
273
-            if (! $collector['hasTimelineData']) {
273
+            if (!$collector['hasTimelineData']) {
274 274
                 continue;
275 275
             }
276 276
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
         array_multisort(...$sortArray);
288 288
 
289 289
         // Ajouter une heure de fin à chaque élément
290
-        array_walk($data, static function (&$row): void {
290
+        array_walk($data, static function(&$row): void {
291 291
             $row['end'] = $row['start'] + $row['duration'];
292 292
         });
293 293
 
@@ -330,14 +330,14 @@  discard block
 block discarded – undo
330 330
      */
331 331
     protected function collectVarData(): array
332 332
     {
333
-        if (! ($this->config->collectVarData ?? true)) {
333
+        if (!($this->config->collectVarData ?? true)) {
334 334
             return [];
335 335
         }
336 336
 
337 337
         $data = [];
338 338
 
339 339
         foreach ($this->collectors as $collector) {
340
-            if (! $collector->hasVarData()) {
340
+            if (!$collector->hasVarData()) {
341 341
                 continue;
342 342
             }
343 343
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
         }
394 394
 
395 395
         // Si on a desactiver le debogage ou l'affichage de la debugbar, on s'arrete
396
-        if (! BLITZ_DEBUG || ! $this->config->show_debugbar) {
396
+        if (!BLITZ_DEBUG || !$this->config->show_debugbar) {
397 397
             return $response;
398 398
         }
399 399
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
         // Mise à jour vers microtime() pour que nous puissions obtenir l'historique
409 409
         $time = sprintf('%.6f', Date::now()->format('U.u'));
410 410
 
411
-        if (! is_dir($this->debugPath)) {
411
+        if (!is_dir($this->debugPath)) {
412 412
             mkdir($this->debugPath, 0o777);
413 413
         }
414 414
 
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 
419 419
         // Les formats non HTML ne doivent pas inclure la barre de débogage,
420 420
         // puis nous envoyons des en-têtes indiquant où trouver les données de débogage pour cette réponse
421
-        if ($request->ajax() || ! str_contains($format, 'html')) {
421
+        if ($request->ajax() || !str_contains($format, 'html')) {
422 422
             return $response
423 423
                 ->withHeader('Debugbar-Time', "{$time}")
424 424
                 ->withHeader('Debugbar-Link', site_url("?debugbar_time={$time}"));
Please login to merge, or discard this patch.