diff --git a/src/Cli/Commands/Encryption/GenerateKey.php b/src/Cli/Commands/Encryption/GenerateKey.php index 5ec97731..3b2f7088 100644 --- a/src/Cli/Commands/Encryption/GenerateKey.php +++ b/src/Cli/Commands/Encryption/GenerateKey.php @@ -69,7 +69,7 @@ public function execute(array $params) $length = 32; } - $this->task('Génération d\'une nouvelle clé de chiffrememt'); + $this->task('Génération d\'une nouvelle clé de chiffrement'); $encodedKey = $this->generateRandomKey($prefix, $length); @@ -80,7 +80,7 @@ public function execute(array $params) } if (! $this->setNewEncryptionKey($encodedKey)) { - $this->writer->error('Erreur dans la configuration d\'une nouvelle clé de chiffrememt dans le fichier `.env`.', true); + $this->writer->error('Erreur dans la configuration d\'une nouvelle clé de chiffrement dans le fichier `.env`.', true); return; } diff --git a/src/Loader/DotEnv.php b/src/Loader/DotEnv.php index a474e97a..f78683e1 100644 --- a/src/Loader/DotEnv.php +++ b/src/Loader/DotEnv.php @@ -115,7 +115,7 @@ public function update(array $data = [], bool $reload = true): bool foreach ($env as $env_key => $env_value) { $entry = explode('=', $env_value, 2); $entry = array_map('trim', $entry); - if ($entry[0] === $key) { + if ($entry[0] === $key || $entry[0] === '# ' . $key) { $env[$env_key] = $key . '=' . (is_string($value) ? '"' . $value . '"' : $value); } else { $env[$env_key] = $env_value; @@ -280,7 +280,7 @@ protected function resolveNestedVariables(string $value): string $value = preg_replace_callback( '/\${([a-zA-Z0-9_]+)}/', - static function ($matchedPatterns) use ($loader): string { + static function ($matchedPatterns) use ($loader) { $nestedVariable = $loader->getVariable($matchedPatterns[1]); if (null === $nestedVariable) {