Skip to content

Commit 6dd958a

Browse files
committed
Check if method inheritEnvironmentVariables exists
1 parent 450e2da commit 6dd958a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dotenv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ private function resolveCommands(string $value, array $loadedVars): string
401401

402402
$process = method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline('echo '.$matches[0]) : new Process('echo '.$matches[0]);
403403

404-
if (!method_exists(Process::class, 'fromShellCommandline')) {
404+
if (!method_exists(Process::class, 'fromShellCommandline') && method_exists(Process::class, 'inheritEnvironmentVariables')) {
405405
// Symfony 3.4 does not inherit env vars by default:
406406
$process->inheritEnvironmentVariables();
407407
}

0 commit comments

Comments
 (0)