enqueue-dev icon indicating copy to clipboard operation
enqueue-dev copied to clipboard

Bad process creation for Symfony > 4.2

Open NicolasGuilloux opened this issue 6 years ago • 2 comments

Hi there !

There is a deprecated for Symfony version above 4.2 where the Process requires an array when built. I noticed this thing for the Async Command bundle but may be present elsewhere. A quick fix is to check the version of Symfony, and choose the appropriate function like bellow:

if (Kernel::MAJOR_VERSION >= 4 && Kernel::MINOR_VERSION >= 2) {
    $process = Process::fromShellCommandline($phpBin.' '.$consoleBin.' '.$this->getCommandLine($command), $this->projectDir);
} else {
    $process = new Process($phpBin.' '.$consoleBin.' '.$this->getCommandLine($command), $this->projectDir);
}

NicolasGuilloux avatar Oct 22 '19 13:10 NicolasGuilloux

It's a deprecation. Process constructor will fall back to fromShellCommandline until Symfony 5.0.

Prefered solution would be to use an array argument.

Steveb-p avatar Oct 22 '19 15:10 Steveb-p

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 21 '19 15:11 stale[bot]