Check if method inheritEnvironmentVariables exists

This commit is contained in:
Chi-teck 2020-11-14 17:10:20 +00:00
parent 1f4625053c
commit bd72a56505
1 changed files with 1 additions and 1 deletions

View File

@ -401,7 +401,7 @@ final class Dotenv
$process = method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline('echo '.$matches[0]) : new Process('echo '.$matches[0]);
if (!method_exists(Process::class, 'fromShellCommandline')) {
if (!method_exists(Process::class, 'fromShellCommandline') && method_exists(Process::class, 'inheritEnvironmentVariables')) {
// Symfony 3.4 does not inherit env vars by default:
$process->inheritEnvironmentVariables();
}