@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | public function __construct(bool $debug = false) |
| 32 | 32 | { |
| 33 | 33 | $this->mailer = new Mailer(); |
| 34 | - $this->mailer->Debugoutput = static function ($str, $level): void { |
|
| 34 | + $this->mailer->Debugoutput = static function($str, $level): void { |
|
| 35 | 35 | service('logger')->info('[Mail][' . $level . ']: ' . $str); |
| 36 | 36 | }; |
| 37 | 37 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function init(array $config): static |
| 45 | 45 | { |
| 46 | - if (! empty($config['username']) && ! empty($config['password'])) { |
|
| 46 | + if (!empty($config['username']) && !empty($config['password'])) { |
|
| 47 | 47 | $this->mailer->SMTPAuth = true; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $instance->initialize(service('request'), service('response'), service('logger')); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - if (! method_exists($instance, $method)) { |
|
| 81 | + if (!method_exists($instance, $method)) { |
|
| 82 | 82 | throw ViewException::invalidComponentMethod($class, $method); |
| 83 | 83 | } |
| 84 | 84 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function prepareParams($params): array |
| 105 | 105 | { |
| 106 | - if ($params === null || $params === '' || $params === [] || (! is_string($params) && ! is_array($params))) { |
|
| 106 | + if ($params === null || $params === '' || $params === [] || (!is_string($params) && !is_array($params))) { |
|
| 107 | 107 | return []; |
| 108 | 108 | } |
| 109 | 109 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $library = str_replace('::', ':', $library); |
| 147 | 147 | |
| 148 | 148 | // Les composants contrôlées peuvent être appelées avec le seul nom de la classe, c'est pourquoi il faut ajouter une méthode par défaut |
| 149 | - if (! str_contains($library, ':')) { |
|
| 149 | + if (!str_contains($library, ':')) { |
|
| 150 | 150 | $library .= ':render'; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - if (! is_object($object)) { |
|
| 179 | + if (!is_object($object)) { |
|
| 180 | 180 | throw ViewException::invalidComponentClass($class); |
| 181 | 181 | } |
| 182 | 182 | |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | |
| 272 | 272 | $output = $instance->{$method}(); |
| 273 | 273 | } elseif (($paramCount === 1) |
| 274 | - && ((! array_key_exists($refParams[0]->name, $params)) |
|
| 274 | + && ((!array_key_exists($refParams[0]->name, $params)) |
|
| 275 | 275 | || (array_key_exists($refParams[0]->name, $params) |
| 276 | 276 | && count($params) !== 1)) |
| 277 | 277 | ) { |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | foreach (array_keys($params) as $key) { |
| 291 | - if (! isset($methodParams[$key])) { |
|
| 291 | + if (!isset($methodParams[$key])) { |
|
| 292 | 292 | throw ViewException::invalidComponentParameter($key); |
| 293 | 293 | } |
| 294 | 294 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * the LICENSE file that was distributed with this source code. |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -if (! function_exists('directory_map')) { |
|
| 12 | +if (!function_exists('directory_map')) { |
|
| 13 | 13 | /** |
| 14 | 14 | * Créer une carte de répertoire |
| 15 | 15 | * |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | -if (! function_exists('directory_mirror')) { |
|
| 59 | +if (!function_exists('directory_mirror')) { |
|
| 60 | 60 | /** |
| 61 | 61 | * Copie récursivement les fichiers et répertoires du répertoire d'origine |
| 62 | 62 | * dans le répertoire cible, c'est-à-dire "miroir" son contenu. |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | -if (! function_exists('write_file')) { |
|
| 72 | +if (!function_exists('write_file')) { |
|
| 73 | 73 | /** |
| 74 | 74 | * Write File |
| 75 | 75 | * |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | -if (! function_exists('delete_files')) { |
|
| 106 | +if (!function_exists('delete_files')) { |
|
| 107 | 107 | /** |
| 108 | 108 | * Delete Files |
| 109 | 109 | * |
@@ -128,18 +128,18 @@ discard block |
||
| 128 | 128 | RecursiveIteratorIterator::CHILD_FIRST |
| 129 | 129 | ) as $object) { |
| 130 | 130 | $filename = $object->getFilename(); |
| 131 | - if (! $hidden && $filename[0] === '.') { |
|
| 131 | + if (!$hidden && $filename[0] === '.') { |
|
| 132 | 132 | continue; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - if (! $htdocs || ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) { |
|
| 135 | + if (!$htdocs || !preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) { |
|
| 136 | 136 | $isDir = $object->isDir(); |
| 137 | 137 | if ($isDir && $delDir) { |
| 138 | 138 | rmdir($object->getPathname()); |
| 139 | 139 | |
| 140 | 140 | continue; |
| 141 | 141 | } |
| 142 | - if (! $isDir) { |
|
| 142 | + if (!$isDir) { |
|
| 143 | 143 | unlink($object->getPathname()); |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | -if (! function_exists('get_filenames')) { |
|
| 155 | +if (!function_exists('get_filenames')) { |
|
| 156 | 156 | /** |
| 157 | 157 | * Get Filenames |
| 158 | 158 | * |
@@ -181,11 +181,11 @@ discard block |
||
| 181 | 181 | RecursiveIteratorIterator::SELF_FIRST |
| 182 | 182 | ) as $name => $object) { |
| 183 | 183 | $basename = pathinfo($name, PATHINFO_BASENAME); |
| 184 | - if (! $hidden && $basename[0] === '.') { |
|
| 184 | + if (!$hidden && $basename[0] === '.') { |
|
| 185 | 185 | continue; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - if ($includeDir || ! $object->isDir()) { |
|
| 188 | + if ($includeDir || !$object->isDir()) { |
|
| 189 | 189 | if ($includePath === false) { |
| 190 | 190 | $files[] = $basename; |
| 191 | 191 | } elseif ($includePath === null) { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | -if (! function_exists('get_dir_file_info')) { |
|
| 208 | +if (!function_exists('get_dir_file_info')) { |
|
| 209 | 209 | /** |
| 210 | 210 | * Get Directory File Information |
| 211 | 211 | * |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | -if (! function_exists('get_file_info')) { |
|
| 254 | +if (!function_exists('get_file_info')) { |
|
| 255 | 255 | /** |
| 256 | 256 | * Get File Info |
| 257 | 257 | * |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | */ |
| 268 | 268 | function get_file_info(string $file, $returnedValues = ['name', 'server_path', 'size', 'date']) |
| 269 | 269 | { |
| 270 | - if (! is_file($file)) { |
|
| 270 | + if (!is_file($file)) { |
|
| 271 | 271 | return null; |
| 272 | 272 | } |
| 273 | 273 | |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | -if (! function_exists('symbolic_permissions')) { |
|
| 320 | +if (!function_exists('symbolic_permissions')) { |
|
| 321 | 321 | /** |
| 322 | 322 | * Symbolic Permissions |
| 323 | 323 | * |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | } |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | -if (! function_exists('octal_permissions')) { |
|
| 368 | +if (!function_exists('octal_permissions')) { |
|
| 369 | 369 | /** |
| 370 | 370 | * Octal Permissions |
| 371 | 371 | * |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | } |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | -if (! function_exists('same_file')) { |
|
| 383 | +if (!function_exists('same_file')) { |
|
| 384 | 384 | /** |
| 385 | 385 | * Checks if two files both exist and have identical hashes |
| 386 | 386 | * |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | } |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | -if (! function_exists('set_realpath')) { |
|
| 395 | +if (!function_exists('set_realpath')) { |
|
| 396 | 396 | /** |
| 397 | 397 | * Set Realpath |
| 398 | 398 | * |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | // Resolve the path |
| 409 | 409 | if (realpath($path) !== false) { |
| 410 | 410 | $path = realpath($path); |
| 411 | - } elseif ($checkExistence && ! is_dir($path) && ! is_file($path)) { |
|
| 411 | + } elseif ($checkExistence && !is_dir($path) && !is_file($path)) { |
|
| 412 | 412 | throw new InvalidArgumentException('Not a valid path: ' . $path); |
| 413 | 413 | } |
| 414 | 414 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | // ================================= FONCTIONS UTIILITAIRES ESSENTIELLES ================================= // |
| 34 | 34 | |
| 35 | -if (! function_exists('env')) { |
|
| 35 | +if (!function_exists('env')) { |
|
| 36 | 36 | /** |
| 37 | 37 | * Obtient une variable d'environnement à partir des sources disponibles et fournit une émulation |
| 38 | 38 | * pour les variables d'environnement non prises en charge ou incohérentes |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | -if (! function_exists('helper')) { |
|
| 51 | +if (!function_exists('helper')) { |
|
| 52 | 52 | /** |
| 53 | 53 | * Charge un fichier d'aide en mémoire. Prend en charge les assistants d'espace de noms, |
| 54 | 54 | * à la fois dans et hors du répertoire 'helpers' d'un répertoire à espace de noms. |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | -if (! function_exists('model')) { |
|
| 67 | +if (!function_exists('model')) { |
|
| 68 | 68 | /** |
| 69 | 69 | * Simple maniere d'obtenir un modele. |
| 70 | 70 | * |
@@ -74,13 +74,13 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @return T |
| 76 | 76 | */ |
| 77 | - function model(array|string $name, ?ConnectionInterface &$conn = null) |
|
| 77 | + function model(array|string $name, ?ConnectionInterface&$conn = null) |
|
| 78 | 78 | { |
| 79 | 79 | return Load::model($name, $conn); |
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | -if (! function_exists('service')) { |
|
| 83 | +if (!function_exists('service')) { |
|
| 84 | 84 | /** |
| 85 | 85 | * Permet un accès plus propre au fichier de configuration des services. |
| 86 | 86 | * Renvoie toujours une instance SHARED de la classe, donc l'appel de la fonction plusieurs fois renvera toujours la même instance. |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | -if (! function_exists('single_service')) { |
|
| 104 | +if (!function_exists('single_service')) { |
|
| 105 | 105 | /** |
| 106 | 106 | * Autoriser l'accès propre à un service. |
| 107 | 107 | * Renvoie toujours une nouvelle instance de la classe. |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | -if (! function_exists('show404')) { |
|
| 124 | +if (!function_exists('show404')) { |
|
| 125 | 125 | /** |
| 126 | 126 | * Afficher une page 404 introuvable dans le navigateur |
| 127 | 127 | */ |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | -if (! function_exists('command')) { |
|
| 134 | +if (!function_exists('command')) { |
|
| 135 | 135 | /** |
| 136 | 136 | * Exécute une seule commande. |
| 137 | 137 | * Entrée attendue dans une seule chaîne comme celle qui serait utilisée sur la ligne de commande elle-même : |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | -if (! function_exists('config')) { |
|
| 197 | +if (!function_exists('config')) { |
|
| 198 | 198 | /** |
| 199 | 199 | * GET/SET App config |
| 200 | 200 | * |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | -if (! function_exists('logger')) { |
|
| 228 | +if (!function_exists('logger')) { |
|
| 229 | 229 | /** |
| 230 | 230 | * Une méthode de commodité pour les événements de journalisation via le système Log. |
| 231 | 231 | * |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | -if (! function_exists('cache')) { |
|
| 259 | +if (!function_exists('cache')) { |
|
| 260 | 260 | /** |
| 261 | 261 | * Une méthode pratique qui donne accès au cache |
| 262 | 262 | * objet. Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | -if (! function_exists('cookie')) { |
|
| 290 | +if (!function_exists('cookie')) { |
|
| 291 | 291 | /** |
| 292 | 292 | * Une méthode pratique qui donne accès à l'objet cookie. |
| 293 | 293 | * Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | -if (! function_exists('session')) { |
|
| 319 | +if (!function_exists('session')) { |
|
| 320 | 320 | /** |
| 321 | 321 | * Une méthode pratique pour accéder à l'instance de session, ou un élément qui a été défini dans la session. |
| 322 | 322 | * |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | |
| 343 | 343 | // =========================== FONCTIONS DE PREVENTION D'ATTAQUE =========================== // |
| 344 | 344 | |
| 345 | -if (! function_exists('esc')) { |
|
| 345 | +if (!function_exists('esc')) { |
|
| 346 | 346 | /** |
| 347 | 347 | * Effectue un simple échappement automatique des données pour des raisons de sécurité. |
| 348 | 348 | * Pourrait envisager de rendre cela plus complexe à une date ultérieure. |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | } |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | -if (! function_exists('h')) { |
|
| 372 | +if (!function_exists('h')) { |
|
| 373 | 373 | /** |
| 374 | 374 | * Méthode pratique pour htmlspecialchars. |
| 375 | 375 | * |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | } |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | -if (! function_exists('purify')) { |
|
| 391 | +if (!function_exists('purify')) { |
|
| 392 | 392 | /** |
| 393 | 393 | * Purifiez l'entrée à l'aide de la classe autonome HTMLPurifier. |
| 394 | 394 | * Utilisez facilement plusieurs configurations de purificateur. |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | -if (! function_exists('remove_invisible_characters')) { |
|
| 407 | +if (!function_exists('remove_invisible_characters')) { |
|
| 408 | 408 | /** |
| 409 | 409 | * Supprimer les caractères invisibles |
| 410 | 410 | * |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | } |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | -if (! function_exists('stringify_attributes')) { |
|
| 420 | +if (!function_exists('stringify_attributes')) { |
|
| 421 | 421 | /** |
| 422 | 422 | * Chaîner les attributs à utiliser dans les balises HTML. |
| 423 | 423 | * |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | |
| 432 | 432 | // ================================= FONCTIONS DE FORMULAIRE ================================= // |
| 433 | 433 | |
| 434 | -if (! function_exists('csrf_token')) { |
|
| 434 | +if (!function_exists('csrf_token')) { |
|
| 435 | 435 | /** |
| 436 | 436 | * Renvoie la valeur de hachage actuelle pour la protection CSRF. |
| 437 | 437 | * Peut être utilisé dans les vues lors de la construction manuelle d'input cachées, ou utilisé dans les variables javascript pour l'utilisation de l'API. |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | -if (! function_exists('csrf_field')) { |
|
| 445 | +if (!function_exists('csrf_field')) { |
|
| 446 | 446 | /** |
| 447 | 447 | * Génère un champ input caché à utiliser dans les formulaires générés manuellement. |
| 448 | 448 | */ |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | } |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | -if (! function_exists('csrf_meta')) { |
|
| 457 | +if (!function_exists('csrf_meta')) { |
|
| 458 | 458 | /** |
| 459 | 459 | * Génère une balise méta à utiliser dans les appels javascript. |
| 460 | 460 | */ |
@@ -466,13 +466,13 @@ discard block |
||
| 466 | 466 | } |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | -if (! function_exists('method_field')) { |
|
| 469 | +if (!function_exists('method_field')) { |
|
| 470 | 470 | /** |
| 471 | 471 | * Générer un champ de formulaire pour usurper le verbe HTTP utilisé par les formulaires. |
| 472 | 472 | */ |
| 473 | 473 | function method_field(string $method): string |
| 474 | 474 | { |
| 475 | - if (! in_array($method = strtoupper($method), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
| 475 | + if (!in_array($method = strtoupper($method), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
| 476 | 476 | throw new InvalidArgumentException(sprintf('Methode %s invalide', $method)); |
| 477 | 477 | } |
| 478 | 478 | |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | |
| 483 | 483 | // ================================= FONCTIONS D'ENVIRONNEMENT D'EXECUTION ================================= // |
| 484 | 484 | |
| 485 | -if (! function_exists('environment')) { |
|
| 485 | +if (!function_exists('environment')) { |
|
| 486 | 486 | /** |
| 487 | 487 | * Renvoi l'environnement d'execution actuel ou determine si on est dans un environnement specifie |
| 488 | 488 | * |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | -if (! function_exists('on_dev')) { |
|
| 523 | +if (!function_exists('on_dev')) { |
|
| 524 | 524 | /** |
| 525 | 525 | * Testez pour voir si nous sommes dans un environnement de développement. |
| 526 | 526 | */ |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | -if (! function_exists('on_prod')) { |
|
| 537 | +if (!function_exists('on_prod')) { |
|
| 538 | 538 | /** |
| 539 | 539 | * Testez pour voir si nous sommes dans un environnement de production. |
| 540 | 540 | */ |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | -if (! function_exists('on_test')) { |
|
| 551 | +if (!function_exists('on_test')) { |
|
| 552 | 552 | /** |
| 553 | 553 | * Testez pour voir si nous sommes dans un environnement de test |
| 554 | 554 | */ |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | } |
| 559 | 559 | } |
| 560 | 560 | |
| 561 | -if (! function_exists('is_cli')) { |
|
| 561 | +if (!function_exists('is_cli')) { |
|
| 562 | 562 | /** |
| 563 | 563 | * Testez pour voir si une demande a été faite à partir de la ligne de commande. |
| 564 | 564 | */ |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | } |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | -if (! function_exists('is_php')) { |
|
| 571 | +if (!function_exists('is_php')) { |
|
| 572 | 572 | /** |
| 573 | 573 | * Détermine si la version actuelle de PHP est égale ou supérieure à la valeur fournie. |
| 574 | 574 | */ |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | } |
| 579 | 579 | } |
| 580 | 580 | |
| 581 | -if (! function_exists('is_windows')) { |
|
| 581 | +if (!function_exists('is_windows')) { |
|
| 582 | 582 | /** |
| 583 | 583 | * Déterminez si l'environnement actuel est basé sur Windows. |
| 584 | 584 | */ |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | } |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | -if (! function_exists('is_https')) { |
|
| 591 | +if (!function_exists('is_https')) { |
|
| 592 | 592 | /** |
| 593 | 593 | * Determines if the application is accessed via an encrypted * (HTTPS) connection. |
| 594 | 594 | */ |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | } |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | -if (! function_exists('is_localfile')) { |
|
| 601 | +if (!function_exists('is_localfile')) { |
|
| 602 | 602 | /** |
| 603 | 603 | * Vérifiez si le fichier auquel vous souhaitez accéder est un fichier local de votre application ou non |
| 604 | 604 | */ |
@@ -608,11 +608,11 @@ discard block |
||
| 608 | 608 | return true; |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | - return ! preg_match('#^(https?://)#i', $name); |
|
| 611 | + return !preg_match('#^(https?://)#i', $name); |
|
| 612 | 612 | } |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | -if (! function_exists('is_online')) { |
|
| 615 | +if (!function_exists('is_online')) { |
|
| 616 | 616 | /** |
| 617 | 617 | * Tester si l'application s'exécute en local ou en ligne. |
| 618 | 618 | */ |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | } |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | -if (! function_exists('is_connected')) { |
|
| 625 | +if (!function_exists('is_connected')) { |
|
| 626 | 626 | /** |
| 627 | 627 | * Verifie si l'utilisateur a une connexion internet active. |
| 628 | 628 | */ |
@@ -632,7 +632,7 @@ discard block |
||
| 632 | 632 | } |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | -if (! function_exists('is_ajax_request')) { |
|
| 635 | +if (!function_exists('is_ajax_request')) { |
|
| 636 | 636 | /** |
| 637 | 637 | * Testez pour voir si une requête contient l'en-tête HTTP_X_REQUESTED_WITH. |
| 638 | 638 | */ |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | } |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | -if (! function_exists('redirection')) { |
|
| 645 | +if (!function_exists('redirection')) { |
|
| 646 | 646 | /** |
| 647 | 647 | * Redirige l'utilisateur |
| 648 | 648 | */ |
@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | } |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | -if (! function_exists('redirect')) { |
|
| 659 | +if (!function_exists('redirect')) { |
|
| 660 | 660 | /** |
| 661 | 661 | * Méthode pratique qui fonctionne avec la $request globale actuelle et |
| 662 | 662 | * l'instance $router à rediriger à l'aide de routes nommées et le routage inversé |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | } |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | -if (! function_exists('back')) { |
|
| 681 | +if (!function_exists('back')) { |
|
| 682 | 682 | /** |
| 683 | 683 | * Retourne a la page precedente |
| 684 | 684 | * |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | } |
| 691 | 691 | } |
| 692 | 692 | |
| 693 | -if (! function_exists('link_to')) { |
|
| 693 | +if (!function_exists('link_to')) { |
|
| 694 | 694 | /** |
| 695 | 695 | * Étant donné une chaîne de contrôleur/méthode et tous les paramètres, |
| 696 | 696 | * tentera de créer l'URL relative à la route correspondante. |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | } |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | -if (! function_exists('clean_path')) { |
|
| 713 | +if (!function_exists('clean_path')) { |
|
| 714 | 714 | /** |
| 715 | 715 | * Une méthode pratique pour nettoyer les chemins pour |
| 716 | 716 | * une sortie plus belle. Utile pour les exceptions |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | } |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | -if (! function_exists('old')) { |
|
| 734 | +if (!function_exists('old')) { |
|
| 735 | 735 | /** |
| 736 | 736 | * Fournit l'accès à "entrée ancienne" qui a été définie dans la session lors d'un redirect()-withInput(). |
| 737 | 737 | * |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | function old(string $key, $default = null, $escape = 'html') |
| 745 | 745 | { |
| 746 | 746 | // Assurez-vous de charger la session |
| 747 | - if (session_status() === PHP_SESSION_NONE && ! on_test()) { |
|
| 747 | + if (session_status() === PHP_SESSION_NONE && !on_test()) { |
|
| 748 | 748 | session(); // @codeCoverageIgnore |
| 749 | 749 | } |
| 750 | 750 | |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | |
| 760 | 760 | // ================================= FONCTIONS DE DEBOGAGE ================================= // |
| 761 | 761 | |
| 762 | -if (! function_exists('deprecationWarning')) { |
|
| 762 | +if (!function_exists('deprecationWarning')) { |
|
| 763 | 763 | /** |
| 764 | 764 | * Méthode d'assistance pour générer des avertissements d'obsolescence |
| 765 | 765 | * |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | } |
| 774 | 774 | } |
| 775 | 775 | |
| 776 | -if (! function_exists('pr')) { |
|
| 776 | +if (!function_exists('pr')) { |
|
| 777 | 777 | /** |
| 778 | 778 | * print_r() convenience function. |
| 779 | 779 | * |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | } |
| 796 | 796 | } |
| 797 | 797 | |
| 798 | -if (! function_exists('pj')) { |
|
| 798 | +if (!function_exists('pj')) { |
|
| 799 | 799 | /** |
| 800 | 800 | * json pretty print convenience function. |
| 801 | 801 | * |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | } |
| 817 | 817 | } |
| 818 | 818 | |
| 819 | -if (! function_exists('trigger_warning')) { |
|
| 819 | +if (!function_exists('trigger_warning')) { |
|
| 820 | 820 | /** |
| 821 | 821 | * Déclenche un E_USER_WARNING. |
| 822 | 822 | */ |
@@ -828,7 +828,7 @@ discard block |
||
| 828 | 828 | |
| 829 | 829 | // ================================= FONCTIONS DIVERSES ================================= // |
| 830 | 830 | |
| 831 | -if (! function_exists('force_https')) { |
|
| 831 | +if (!function_exists('force_https')) { |
|
| 832 | 832 | /** |
| 833 | 833 | * Utilisé pour forcer l'accès à une page via HTTPS. |
| 834 | 834 | * Utilise une redirection standard, plus définira l'en-tête HSTS |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | |
| 856 | 856 | // Si la session est active, nous devons régénérer |
| 857 | 857 | // l'ID de session pour des raisons de sécurité. |
| 858 | - if (! on_test() && session_status() === PHP_SESSION_ACTIVE) { |
|
| 858 | + if (!on_test() && session_status() === PHP_SESSION_ACTIVE) { |
|
| 859 | 859 | session()->regenerate(); // @codeCoverageIgnore |
| 860 | 860 | } |
| 861 | 861 | |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | } |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | -if (! function_exists('get_type_name')) { |
|
| 874 | +if (!function_exists('get_type_name')) { |
|
| 875 | 875 | /** |
| 876 | 876 | * Renvoie la classe d'objets ou le type var de ce n'est pas un objet |
| 877 | 877 | * |
@@ -885,7 +885,7 @@ discard block |
||
| 885 | 885 | } |
| 886 | 886 | } |
| 887 | 887 | |
| 888 | -if (! function_exists('ip_address')) { |
|
| 888 | +if (!function_exists('ip_address')) { |
|
| 889 | 889 | /** |
| 890 | 890 | * Renvoie l'adresse IP de l'utilisateur actuel |
| 891 | 891 | */ |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | } |
| 896 | 896 | } |
| 897 | 897 | |
| 898 | -if (! function_exists('is_really_writable')) { |
|
| 898 | +if (!function_exists('is_really_writable')) { |
|
| 899 | 899 | /** |
| 900 | 900 | * Tests d'inscriptibilité des fichiers |
| 901 | 901 | */ |
@@ -905,7 +905,7 @@ discard block |
||
| 905 | 905 | } |
| 906 | 906 | } |
| 907 | 907 | |
| 908 | -if (! function_exists('lang')) { |
|
| 908 | +if (!function_exists('lang')) { |
|
| 909 | 909 | /** |
| 910 | 910 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
| 911 | 911 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | } |
| 917 | 917 | } |
| 918 | 918 | |
| 919 | -if (! function_exists('__')) { |
|
| 919 | +if (!function_exists('__')) { |
|
| 920 | 920 | /** |
| 921 | 921 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
| 922 | 922 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -929,7 +929,7 @@ discard block |
||
| 929 | 929 | } |
| 930 | 930 | } |
| 931 | 931 | |
| 932 | -if (! function_exists('namespace_split')) { |
|
| 932 | +if (!function_exists('namespace_split')) { |
|
| 933 | 933 | /** |
| 934 | 934 | * Séparez l'espace de noms du nom de classe. |
| 935 | 935 | * |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | } |
| 951 | 951 | } |
| 952 | 952 | |
| 953 | -if (! function_exists('view_exist')) { |
|
| 953 | +if (!function_exists('view_exist')) { |
|
| 954 | 954 | /** |
| 955 | 955 | * Verifie si un fichier de vue existe. Utile pour limiter les failles include |
| 956 | 956 | */ |
@@ -960,7 +960,7 @@ discard block |
||
| 960 | 960 | } |
| 961 | 961 | } |
| 962 | 962 | |
| 963 | -if (! function_exists('view')) { |
|
| 963 | +if (!function_exists('view')) { |
|
| 964 | 964 | /** |
| 965 | 965 | * Saisit la classe compatible avec le RendererInterface et lui demande d'effectuer le rendu de la vue spécifiée. |
| 966 | 966 | * Fournit simplement une méthode de commodité qui peut être utilisée dans les contrôleurs, les bibliothèques et les routes sous forme de closure. |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | } |
| 976 | 976 | } |
| 977 | 977 | |
| 978 | -if (! function_exists('component')) { |
|
| 978 | +if (!function_exists('component')) { |
|
| 979 | 979 | /** |
| 980 | 980 | * Les composants de vue sont utilisées dans les vues pour insérer des morceaux de HTML qui sont gérés par d'autres classes. |
| 981 | 981 | * |
@@ -991,7 +991,7 @@ discard block |
||
| 991 | 991 | } |
| 992 | 992 | } |
| 993 | 993 | |
| 994 | -if (! function_exists('flash')) { |
|
| 994 | +if (!function_exists('flash')) { |
|
| 995 | 995 | /** |
| 996 | 996 | * Fournisseur d'acces rapide a la classe PHP Flash |
| 997 | 997 | * |
@@ -1023,7 +1023,7 @@ discard block |
||
| 1023 | 1023 | }*/ |
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | -if (! function_exists('geo_ip')) { |
|
| 1026 | +if (!function_exists('geo_ip')) { |
|
| 1027 | 1027 | /** |
| 1028 | 1028 | * Recuperation des coordonnees (pays, ville, etc) d'un utilisateur en fonction de son ip |
| 1029 | 1029 | */ |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | } |
| 1034 | 1034 | } |
| 1035 | 1035 | |
| 1036 | -if (! function_exists('to_stream')) { |
|
| 1036 | +if (!function_exists('to_stream')) { |
|
| 1037 | 1037 | /** |
| 1038 | 1038 | * Créez un nouveau flux basé sur le type d'entrée. |
| 1039 | 1039 | * |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | } |
| 1055 | 1055 | } |
| 1056 | 1056 | |
| 1057 | -if (! function_exists('value')) { |
|
| 1057 | +if (!function_exists('value')) { |
|
| 1058 | 1058 | /** |
| 1059 | 1059 | * Renvoie la valeur par défaut de la valeur donnée. |
| 1060 | 1060 | */ |
@@ -1064,7 +1064,7 @@ discard block |
||
| 1064 | 1064 | } |
| 1065 | 1065 | } |
| 1066 | 1066 | |
| 1067 | -if (! function_exists('collect')) { |
|
| 1067 | +if (!function_exists('collect')) { |
|
| 1068 | 1068 | /** |
| 1069 | 1069 | * Créez une collection à partir de la valeur donnée. |
| 1070 | 1070 | */ |
@@ -1074,7 +1074,7 @@ discard block |
||
| 1074 | 1074 | } |
| 1075 | 1075 | } |
| 1076 | 1076 | |
| 1077 | -if (! function_exists('with')) { |
|
| 1077 | +if (!function_exists('with')) { |
|
| 1078 | 1078 | /** |
| 1079 | 1079 | * Renvoie la valeur donnée, éventuellement transmise via le rappel donné. |
| 1080 | 1080 | * |
@@ -1086,7 +1086,7 @@ discard block |
||
| 1086 | 1086 | } |
| 1087 | 1087 | } |
| 1088 | 1088 | |
| 1089 | -if (! function_exists('tap')) { |
|
| 1089 | +if (!function_exists('tap')) { |
|
| 1090 | 1090 | /** |
| 1091 | 1091 | * Appelez la Closure donnée avec cette instance puis renvoyez l'instance. |
| 1092 | 1092 | */ |
@@ -1096,7 +1096,7 @@ discard block |
||
| 1096 | 1096 | } |
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | -if (! function_exists('last')) { |
|
| 1099 | +if (!function_exists('last')) { |
|
| 1100 | 1100 | /** |
| 1101 | 1101 | * Recupere le dernier element d'un tableau |
| 1102 | 1102 | * |
@@ -1112,7 +1112,7 @@ discard block |
||
| 1112 | 1112 | } |
| 1113 | 1113 | } |
| 1114 | 1114 | |
| 1115 | -if (! function_exists('invade')) { |
|
| 1115 | +if (!function_exists('invade')) { |
|
| 1116 | 1116 | /** |
| 1117 | 1117 | * Cette classe offre une fonction d'invasion qui vous permettra de lire / écrire des propriétés privées d'un objet. |
| 1118 | 1118 | * Il vous permettra également de définir, obtenir et appeler des méthodes privées. |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $config = config('cache'); |
| 54 | 54 | $handler = $this->argument('driver', $params[0] ?? $config['handler']); |
| 55 | 55 | |
| 56 | - if (! array_key_exists($handler, $config['valid_handlers'])) { |
|
| 56 | + if (!array_key_exists($handler, $config['valid_handlers'])) { |
|
| 57 | 57 | $this->fail($handler . ' n\'est pas un gestionnaire de cache valide.'); |
| 58 | 58 | |
| 59 | 59 | return; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $config['handler'] = $handler; |
| 63 | 63 | $cache = service('cache', $config); |
| 64 | 64 | |
| 65 | - if (! $cache->clear()) { |
|
| 65 | + if (!$cache->clear()) { |
|
| 66 | 66 | // @codeCoverageIgnoreStart |
| 67 | 67 | $this->fail('Erreur lors de l\'effacement du cache.'); |
| 68 | 68 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | foreach ($options as $key => $value) { |
| 159 | 159 | $key = preg_replace('/^\-\-/', '', $key); |
| 160 | - if (! isset($options[$key])) { |
|
| 160 | + if (!isset($options[$key])) { |
|
| 161 | 161 | $options[$key] = $value; |
| 162 | 162 | } |
| 163 | 163 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public function commandExists(string $commandName): bool |
| 172 | 172 | { |
| 173 | - return ! empty($this->_commands[$commandName]); |
|
| 173 | + return !empty($this->_commands[$commandName]); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | foreach ($files as $file) { |
| 206 | 206 | $className = $locator->findQualifiedNameFromPath($file); |
| 207 | 207 | |
| 208 | - if ($className === false || ! class_exists($className)) { |
|
| 208 | + if ($className === false || !class_exists($className)) { |
|
| 209 | 209 | continue; |
| 210 | 210 | } |
| 211 | 211 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $class = new ReflectionClass($className); |
| 232 | 232 | $logger = $logger ?: service('logger'); |
| 233 | 233 | |
| 234 | - if (! $class->isInstantiable() || ! $class->isSubclassOf(Command::class)) { |
|
| 234 | + if (!$class->isInstantiable() || !$class->isSubclassOf(Command::class)) { |
|
| 235 | 235 | throw CLIException::invalidCommand($className); |
| 236 | 236 | } |
| 237 | 237 | |
@@ -258,13 +258,13 @@ discard block |
||
| 258 | 258 | $value = (array) $value; |
| 259 | 259 | |
| 260 | 260 | $description = $value[0]; |
| 261 | - if (! is_string($description)) { |
|
| 261 | + if (!is_string($description)) { |
|
| 262 | 262 | continue; |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | $default = $value[1] ?? null; |
| 266 | 266 | $filter = $value[2] ?? null; |
| 267 | - if ($filter !== null && ! is_callable($filter)) { |
|
| 267 | + if ($filter !== null && !is_callable($filter)) { |
|
| 268 | 268 | $filter = null; |
| 269 | 269 | } |
| 270 | 270 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | $value = (array) $value; |
| 277 | 277 | |
| 278 | 278 | $description = $value[0]; |
| 279 | - if (! is_string($description)) { |
|
| 279 | + if (!is_string($description)) { |
|
| 280 | 280 | continue; |
| 281 | 281 | } |
| 282 | 282 | |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | $console = $this; |
| 289 | - $action = function (?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) { |
|
| 289 | + $action = function(?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) { |
|
| 290 | 290 | $this->name(); // ne pas retirer. car en cas, d'absence, cs-fixer mettra cette fonction en static. Et php-cli generera une erreur |
| 291 | 291 | |
| 292 | 292 | foreach ($instance->required as $package) { |
@@ -297,9 +297,9 @@ discard block |
||
| 297 | 297 | /** @var Interactor $io */ |
| 298 | 298 | $io = $console->io(); |
| 299 | 299 | |
| 300 | - if (! InstalledVersions::isInstalled($package)) { |
|
| 300 | + if (!InstalledVersions::isInstalled($package)) { |
|
| 301 | 301 | $io->info('Cette commande nécessite le package "' . $package . '" mais vous ne l\'avez pas', true); |
| 302 | - if (! $io->confirm('Voulez-vous l\'installer maintenant ?')) { |
|
| 302 | + if (!$io->confirm('Voulez-vous l\'installer maintenant ?')) { |
|
| 303 | 303 | return; |
| 304 | 304 | } |
| 305 | 305 | |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | $suppress = $suppress ?: $console->suppress; |
| 318 | - if (! $suppress) { |
|
| 318 | + if (!$suppress) { |
|
| 319 | 319 | $console->start($instance); |
| 320 | 320 | } |
| 321 | 321 | |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | $result = $instance->setOptions($options)->setArguments($arguments)->execute($parameters); |
| 332 | 332 | |
| 333 | - if (! $suppress) { |
|
| 333 | + if (!$suppress) { |
|
| 334 | 334 | $console->end(); |
| 335 | 335 | } |
| 336 | 336 | |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | |
| 346 | 346 | private function registerException(Logger $logger) |
| 347 | 347 | { |
| 348 | - $this->onException(static function (Throwable $e, int $exitCode) use ($logger): void { |
|
| 348 | + $this->onException(static function(Throwable $e, int $exitCode) use ($logger): void { |
|
| 349 | 349 | $logger->error((string) $e, ['exitCode' => $exitCode, 'klinge' => true]); |
| 350 | 350 | }); |
| 351 | 351 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
| 55 | 55 | { |
| 56 | 56 | if ($this->isReading($request) || $this->runningUnitTests() || $this->inExceptArray($request) || $this->tokensMatch($request)) { |
| 57 | - return tap($handler->handle($request), function ($response) use ($request) { |
|
| 57 | + return tap($handler->handle($request), function($response) use ($request) { |
|
| 58 | 58 | if ($this->shouldAddXsrfTokenCookie()) { |
| 59 | 59 | $this->addCookieToResponse($request, $response); |
| 60 | 60 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $token = $request->input('_token') ?: $request->header('X-CSRF-TOKEN'); |
| 119 | 119 | |
| 120 | - if (! $token && $header = $request->header('X-XSRF-TOKEN')) { |
|
| 120 | + if (!$token && $header = $request->header('X-XSRF-TOKEN')) { |
|
| 121 | 121 | try { |
| 122 | 122 | $token = CookieValuePrefix::remove($this->encrypter->decrypt($header)); |
| 123 | 123 | } catch (EncryptionException) { |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $response = $response->toResponse($request); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - if (! ($response instanceof Response)) { |
|
| 150 | + if (!($response instanceof Response)) { |
|
| 151 | 151 | return $response; |
| 152 | 152 | } |
| 153 | 153 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | foreach ($data as $key => $value) { |
| 64 | 64 | $replacementKey = "\n{$key} = {$value}"; |
| 65 | - if (! str_contains($oldFileContents, $key)) { |
|
| 65 | + if (!str_contains($oldFileContents, $key)) { |
|
| 66 | 66 | if (file_put_contents($this->path, $replacementKey, FILE_APPEND) === false) { |
| 67 | 67 | return false; |
| 68 | 68 | } |
@@ -129,18 +129,18 @@ discard block |
||
| 129 | 129 | public function parse(): ?array |
| 130 | 130 | { |
| 131 | 131 | // Nous ne voulons pas imposer la présence d'un fichier .env, ils devraient être facultatifs. |
| 132 | - if (! is_file($this->path)) { |
|
| 132 | + if (!is_file($this->path)) { |
|
| 133 | 133 | return null; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | // Assurez-vous que le fichier est lisible |
| 137 | - if (! is_readable($this->path)) { |
|
| 137 | + if (!is_readable($this->path)) { |
|
| 138 | 138 | throw new InvalidArgumentException("Le fichier `.env` est n'est pas lisible: {$this->path}"); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | $vars = []; |
| 142 | 142 | |
| 143 | - $lines = file($this->path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|
| 143 | + $lines = file($this->path, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); |
|
| 144 | 144 | |
| 145 | 145 | foreach ($lines as $line) { |
| 146 | 146 | // C'est un commentaire? |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | protected function setVariable(string $name, string $value = '') |
| 168 | 168 | { |
| 169 | - if (! getenv($name, true)) { |
|
| 169 | + if (!getenv($name, true)) { |
|
| 170 | 170 | putenv("{$name}={$value}"); |
| 171 | 171 | } |
| 172 | 172 | if (empty($_ENV[$name])) { |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | if (str_contains($value, '$')) { |
| 268 | 268 | $value = preg_replace_callback( |
| 269 | 269 | '/\${([a-zA-Z0-9_\.]+)}/', |
| 270 | - function ($matchedPatterns) { |
|
| 270 | + function($matchedPatterns) { |
|
| 271 | 271 | $nestedVariable = $this->getVariable($matchedPatterns[1]); |
| 272 | 272 | |
| 273 | 273 | if ($nestedVariable === null) { |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | public static function locator(bool $shared = true): LocatorInterface |
| 303 | 303 | { |
| 304 | 304 | if ($shared) { |
| 305 | - if (! isset(static::$instances[Locator::class])) { |
|
| 305 | + if (!isset(static::$instances[Locator::class])) { |
|
| 306 | 306 | $locator = new Locator(static::autoloader()); |
| 307 | 307 | if (true === config('optimize.locator_cache_enabled', false)) { |
| 308 | 308 | static::$instances[Locator::class] = new LocatorCached($locator, new FileVarExportHandler(FRAMEWORK_STORAGE_PATH . 'cache')); |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | |
| 632 | 632 | protected static function cacheServices(): void |
| 633 | 633 | { |
| 634 | - if (! static::$discovered) { |
|
| 634 | + if (!static::$discovered) { |
|
| 635 | 635 | $locator = static::locator(); |
| 636 | 636 | $files = $locator->search('Config/Services'); |
| 637 | 637 | |