Skip to content

Commit 7ead8d0

Browse files
author
Xavier Marchegay
committed
Fix Symfony 5/6
1 parent 0a42088 commit 7ead8d0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Model/SubprocessInstance.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,14 @@ public function buildProcess()
121121
$arguments[] = $this->processCode;
122122

123123
$this->process = new Process($arguments, null, null, $this->input);
124-
$this->process->setCommandLine($this->process->getCommandLine());
125-
$this->process->inheritEnvironmentVariables();
124+
125+
if (method_exists(Process::class, 'fromShellCommandline')) {
126+
$this->process = Process::fromShellCommandline($this->process->getCommandLine(), null, null, $this->input);
127+
} else {
128+
$this->process->setCommandLine($this->process->getCommandLine());
129+
$this->process->inheritEnvironmentVariables();
130+
}
131+
126132
$this->process->enableOutput();
127133

128134
return $this;

0 commit comments

Comments
 (0)