/**
  * @param ConsoleTerminateEvent $event
  */
 public function onConsoleTerminate(ConsoleTerminateEvent $event)
 {
     $statusCode = $event->getExitCode();
     $command = $event->getCommand();
     if ($statusCode === 0) {
         return;
     }
     if ($statusCode > 255) {
         $statusCode = 255;
         $event->setExitCode($statusCode);
     }
     $this->logger->warning(sprintf('Command `%s` exited with status code %d', $command->getName(), $statusCode));
 }
 /**
  * Update exit code after launch chain of commands.
  *
  * @param   ConsoleTerminateEvent   $event
  */
 public function onConsoleTerminate(ConsoleTerminateEvent $event)
 {
     if ($this->manager->getLastChain() === $event->getCommand()->getName()) {
         $event->setExitCode($this->manager->getChainExitCode());
     }
 }