Skip to content

Bad process creation for Symfony > 4.2 #973

Open
@NicolasGuilloux

Description

@NicolasGuilloux

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions