8000 [DI] fix dumping env vars · symfony/symfony@746a8d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 746a8d1

Browse files
[DI] fix dumping env vars
1 parent a580688 commit 746a8d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ private function addDefaultParametersMethod(): string
14131413
$export = $this->exportParameters([$value]);
14141414
$export = explode('0 => ', substr(rtrim($export, " ]\n"), 2, -1), 2);
14151415

1416-
if (preg_match("/\\\$this->(?:getEnv\('(?:\w++:)*+\w++'\)|targetDir\.'')/", $export[1])) {
1416+
if (preg_match("/\\\$this->(?:getEnv\('(?:[-.\w]*+:)*+\w++'\)|targetDir\.'')/", $export[1])) {
14171417
$dynamicPhp[$key] = sprintf('%scase %s: $value = %s; break;', $export[0], $this->export($key), $export[1]);
14181418
} else {
14191419
$php[] = sprintf('%s%s => %s,', $export[0], $this->export($key), $export[1]);
@@ -1819,7 +1819,7 @@ private function dumpParameter(string $name): string
18191819
return $dumpedValue;
18201820
}
18211821

1822-
if (!preg_match("/\\\$this->(?:getEnv\('(?:\w++:)*+\w++'\)|targetDir\.'')/", $dumpedValue)) {
1822+
if (!preg_match("/\\\$this->(?:getEnv\('(?:[-.\w]*+:)*+\w++'\)|targetDir\.'')/", $dumpedValue)) {
18231823
return sprintf('$this->parameters[%s]', $this->doExport($name));
18241824
}
18251825
}

0 commit comments

Comments
 (0)
0