1

This is the process command I have to execute, The argument contactIds is an array.

 $process = new Process([
            "php",
            "../fairgate4/bin/console",
            "contactlist:remove",
            $contactIds  // array
        ]);
 $process->start();

Symfony throws an error for this argument :

Argument 1 passed to Symfony\Component\Process\Process::escapeArgument() must be of the type string or null, array given

manu
  • 351
  • 2
  • 15

1 Answers1

0
 $contactIdStr = implode(' ',contactIds); // converted array to string
 $process = new Process([
            "php",
            "../fairgate4/bin/console",
            "contactlist:remove",
            $contactIdStr
        ]);
 $process->start();
manu
  • 351
  • 2
  • 15