/** * @param ProcessEvent $event */ public function stopOnFailure(ProcessEvent $event) { /** @var ScenarioProcess $process */ $process = $event->getProcess(); if ($process->withError()) { $this->parallelProcessRunner->stop(); $this->terminate(1); } }
/** * @param ProcessEvent $event */ public function decrement(ProcessEvent $event) { if ($this->balance) { /** @var ScenarioProcess $process */ $process = $event->getProcess(); /** @var ProcessOptionScalar $profileOption */ $profileOption = $process->getProcessOption('profile'); $this->balance[$profileOption->getOptionValue()]--; } }
/** * @param ProcessEvent $event */ public function afterStop(ProcessEvent $event) { /** @var ScenarioProcess $process */ $process = $event->getProcess(); if ($process->withError()) { $this->output->writeln(sprintf('<comment>%s</comment>', $process->getOutput())); $this->output->writeln(sprintf('<error>%s</error>', $process->getErrorOutput())); } else { $this->output->writeln(sprintf('<info>%s</info>', $process->getOutput())); } }
/** * @param ProcessEvent $event */ public function stopAfter(ProcessEvent $event) { $process = $event->getProcess(); if (OutputInterface::VERBOSITY_DEBUG <= $this->getSymfonyStyle()->getVerbosity()) { $this->getSymfonyStyle()->writeln($process->getCommandLine()); $error = trim($process->getErrorOutput()); if ($error) { $this->getSymfonyStyle()->writeln($error); } $output = trim($process->getOutput()); if ($output) { $this->getSymfonyStyle()->writeln($output); } } else { $this->progressBarHelper->advance($process->getWorkingDirectory()); } }