@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | // Essayez plusieurs fois en cas de mèches persistantes |
| 128 | 128 | $attempts = 10; |
| 129 | 129 | |
| 130 | - while ((bool) $attempts && ! delete_files($directory, true, false, true)) { |
|
| 130 | + while ((bool) $attempts && !delete_files($directory, true, false, true)) { |
|
| 131 | 131 | // @codeCoverageIgnoreStart |
| 132 | 132 | $attempts--; |
| 133 | 133 | usleep(100000); // .1s |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | // Rechercher un fichier existant |
| 468 | 468 | if (file_exists($to)) { |
| 469 | 469 | // S'il n'est pas remplacé ou si les fichiers sont identiques, envisagez de réussir |
| 470 | - if (! $replace || same_file($from, $to)) { |
|
| 470 | + if (!$replace || same_file($from, $to)) { |
|
| 471 | 471 | return; |
| 472 | 472 | } |
| 473 | 473 | |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | // Assurez-vous que le répertoire existe |
| 484 | - if (! is_dir($directory = pathinfo($to, PATHINFO_DIRNAME))) { |
|
| 484 | + if (!is_dir($directory = pathinfo($to, PATHINFO_DIRNAME))) { |
|
| 485 | 485 | mkdir($directory, 0o775, true); |
| 486 | 486 | } |
| 487 | 487 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // Si cela semble être une URL relative, alors convertissez-la en URL complète |
| 65 | 65 | // pour une meilleure sécurité. |
| 66 | - if (! str_starts_with($uri, 'http')) { |
|
| 66 | + if (!str_starts_with($uri, 'http')) { |
|
| 67 | 67 | $uri = site_url($uri); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | { |
| 125 | 125 | $request = $this->generator->getRequest(); |
| 126 | 126 | |
| 127 | - $intended = $request->method() === 'GET' && ! $request->expectsJson() |
|
| 127 | + $intended = $request->method() === 'GET' && !$request->expectsJson() |
|
| 128 | 128 | ? $this->generator->full() |
| 129 | 129 | : $this->generator->previous(); |
| 130 | 130 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $errors = [$key => $errors]; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - if (! empty($errors)) { |
|
| 181 | + if (!empty($errors)) { |
|
| 182 | 182 | Services::viewer()->share('errors', new ErrorBag($this->session->flashErrors($errors, $key))); |
| 183 | 183 | } |
| 184 | 184 | |
@@ -172,11 +172,11 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | $authority = $this->host; |
| 174 | 174 | |
| 175 | - if (! empty($this->getUserInfo())) { |
|
| 175 | + if (!empty($this->getUserInfo())) { |
|
| 176 | 176 | $authority = $this->getUserInfo() . '@' . $authority; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - if (! empty($this->port) && ! $ignorePort) { |
|
| 179 | + if (!empty($this->port) && !$ignorePort) { |
|
| 180 | 180 | // N'ajoute pas de port s'il s'agit d'un port standard pour ce schéma |
| 181 | 181 | if ($this->port !== $this->defaultPorts[$this->scheme]) { |
| 182 | 182 | $authority .= ':' . $this->port; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | { |
| 196 | 196 | $userInfo = $this->user; |
| 197 | 197 | |
| 198 | - if ($this->showPassword === true && ! empty($this->password)) { |
|
| 198 | + if ($this->showPassword === true && !empty($this->password)) { |
|
| 199 | 199 | $userInfo .= ':' . $this->password; |
| 200 | 200 | } |
| 201 | 201 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | $vars = $this->query; |
| 246 | 246 | |
| 247 | 247 | if (array_key_exists('except', $options)) { |
| 248 | - if (! is_array($options['except'])) { |
|
| 248 | + if (!is_array($options['except'])) { |
|
| 249 | 249 | $options['except'] = [$options['except']]; |
| 250 | 250 | } |
| 251 | 251 | |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | } elseif (array_key_exists('only', $options)) { |
| 256 | 256 | $temp = []; |
| 257 | 257 | |
| 258 | - if (! is_array($options['only'])) { |
|
| 258 | + if (!is_array($options['only'])) { |
|
| 259 | 259 | $options['only'] = [$options['only']]; |
| 260 | 260 | } |
| 261 | 261 | |
@@ -356,11 +356,11 @@ discard block |
||
| 356 | 356 | public static function createURIString(?string $scheme = null, ?string $authority = null, ?string $path = null, ?string $query = null, ?string $fragment = null): string |
| 357 | 357 | { |
| 358 | 358 | $uri = ''; |
| 359 | - if (! empty($scheme)) { |
|
| 359 | + if (!empty($scheme)) { |
|
| 360 | 360 | $uri .= $scheme . '://'; |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | - if (! empty($authority)) { |
|
| 363 | + if (!empty($authority)) { |
|
| 364 | 364 | $uri .= $authority; |
| 365 | 365 | } |
| 366 | 366 | |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | { |
| 387 | 387 | $parts = parse_url($str); |
| 388 | 388 | |
| 389 | - if (empty($parts['host']) && ! empty($parts['path'])) { |
|
| 389 | + if (empty($parts['host']) && !empty($parts['path'])) { |
|
| 390 | 390 | $parts['host'] = $parts['path']; |
| 391 | 391 | unset($parts['path']); |
| 392 | 392 | } |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | // Ne peut pas avoir de début ? |
| 534 | - if (! empty($query) && str_starts_with($query, '?')) { |
|
| 534 | + if (!empty($query) && str_starts_with($query, '?')) { |
|
| 535 | 535 | $query = substr($query, 1); |
| 536 | 536 | } |
| 537 | 537 | |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | $temp = []; |
| 597 | 597 | |
| 598 | 598 | foreach ($this->query as $key => $value) { |
| 599 | - if (! in_array($key, $params, true)) { |
|
| 599 | + if (!in_array($key, $params, true)) { |
|
| 600 | 600 | continue; |
| 601 | 601 | } |
| 602 | 602 | |
@@ -667,19 +667,19 @@ discard block |
||
| 667 | 667 | */ |
| 668 | 668 | protected function applyParts(array $parts) |
| 669 | 669 | { |
| 670 | - if (! empty($parts['host'])) { |
|
| 670 | + if (!empty($parts['host'])) { |
|
| 671 | 671 | $this->host = $parts['host']; |
| 672 | 672 | } |
| 673 | - if (! empty($parts['user'])) { |
|
| 673 | + if (!empty($parts['user'])) { |
|
| 674 | 674 | $this->user = $parts['user']; |
| 675 | 675 | } |
| 676 | - if (! empty($parts['path'])) { |
|
| 676 | + if (!empty($parts['path'])) { |
|
| 677 | 677 | $this->path = $this->filterPath($parts['path']); |
| 678 | 678 | } |
| 679 | - if (! empty($parts['query'])) { |
|
| 679 | + if (!empty($parts['query'])) { |
|
| 680 | 680 | $this->setQuery($parts['query']); |
| 681 | 681 | } |
| 682 | - if (! empty($parts['fragment'])) { |
|
| 682 | + if (!empty($parts['fragment'])) { |
|
| 683 | 683 | $this->fragment = $parts['fragment']; |
| 684 | 684 | } |
| 685 | 685 | |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | $this->password = $parts['pass']; |
| 702 | 702 | } |
| 703 | 703 | |
| 704 | - if (! empty($parts['path'])) { |
|
| 704 | + if (!empty($parts['path'])) { |
|
| 705 | 705 | $this->segments = explode('/', trim($parts['path'], '/')); |
| 706 | 706 | } |
| 707 | 707 | } |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | $transformed = clone $relative; |
| 729 | 729 | |
| 730 | 730 | // 5.2.2 Transformer les références dans une méthode non stricte (pas de schéma) |
| 731 | - if (! empty($relative->getAuthority())) { |
|
| 731 | + if (!empty($relative->getAuthority())) { |
|
| 732 | 732 | $transformed->setAuthority($relative->getAuthority()) |
| 733 | 733 | ->setPath($relative->getPath()) |
| 734 | 734 | ->setQuery($relative->getQuery()); |
@@ -768,7 +768,7 @@ discard block |
||
| 768 | 768 | */ |
| 769 | 769 | protected function mergePaths(self $base, self $reference): string |
| 770 | 770 | { |
| 771 | - if (! empty($base->getAuthority()) && empty($base->getPath())) { |
|
| 771 | + if (!empty($base->getAuthority()) && empty($base->getPath())) { |
|
| 772 | 772 | return '/' . ltrim($reference->getPath(), '/ '); |
| 773 | 773 | } |
| 774 | 774 | |
@@ -255,7 +255,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -62,7 +62,7 @@ |
||
| 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 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -108,7 +108,7 @@ discard block |
||
| 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 |
||
| 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'), |
@@ -16,12 +16,12 @@ discard block |
||
| 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 |
||
| 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 | }; |
@@ -32,7 +32,7 @@ discard block |
||
| 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 |
||
| 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 | |