for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Zenstruck\ScheduleBundle\Schedule\Task;
use Symfony\Component\Process\Process;
use Zenstruck\ScheduleBundle\Schedule\HasMissingDependencyMessage;
use Zenstruck\ScheduleBundle\Schedule\Task;
/**
* @author Kevin Bond <[email protected]>
*/
final class ProcessTask extends Task implements HasMissingDependencyMessage
{
/** @var Process */
private $process;
* @param string|Process $process
public function __construct($process)
if (!$process instanceof Process) {
$process = Process::fromShellCommandline($process);
}
$this->process = $process;
parent::__construct($process->getCommandLine());
public function getProcess(): Process
return $this->process;
public function getContext(): array
return [
'Command Line' => $this->process->getCommandLine(),
'Command Timeout' => (string) $this->process->getTimeout(),
];
public static function getMissingDependencyMessage(): string
return \sprintf('"symfony/process" is required to use "%s". Install with "composer require symfony/process".', self::class);