* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Event; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; /** * Allows to handle throwables thrown while running a command. * * @author Wouter de Jong */ final class ConsoleErrorEvent extends ConsoleEvent { private $error; private $exitCode; public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null) { parent::__construct($command, $input, $output); $this->error = $error; } public function getError(): \Throwable { return $this->error; } public function setError(\Throwable $error): void { $this->error = $error; } public function setExitCode(int $exitCode): void { $this->exitCode = $exitCode; $r = new \ReflectionProperty($this->error, 'code'); $r->setAccessible(true); $r->setValue($this->error, $this->exitCode); } public function getExitCode(): int { return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); } } __halt_compiler();----SIGNATURE:----q6QCf4DMNZ/nY401iM3l0vD/ftK/LXKZyLNzCoIQDJjnxW7btYJM56UYG4a30U17tHfhEDvL4lg3hjiAciiFNfUXtE2pZ+eevFIMzdEwwHZLSAAgrsXixIIsZeQRH1lKuk6alk0yVziylgI5J9KZcod6UUWKzTm2w1rJ0nFzMZ6xjzWYn8ml87Ze7o4lqDMBipKflbUVe0Zx2WZO3rZLPG8BOPvbAioUKcXhiPa4/Snnn742g0eGcheE5zsGl/KlILXsA77XENNNwC6o9WQSRKmlP5GZqtmUc5D5YYgyZ3P9qOORQ0esxonIIZeRrz0XOXto/JPekVqYAKd88BFOIHPBwEE7Ms2M9xt/T/8zr8XVN5CtdQFsExMJUsu4KWkgsKnpDVAOI9M551p1wFoPf111gC5IDNybJ8WRkCmsEjYFqMk0jYcFkaMlDwK3L1YwFghnbKG3z0Urq7io1mE2603tkGx9c1aG6vB/7GmtDawQQeA+H4d2/tkyby6cf5ridGRhzXWYFyy+6nC9WU1qaQdSXz2RcJEv5uNz83tfOuSS8oBeR1w4ueaKFERIGo/HhgnVOTC3R/0zfVTX2rUD0iCXqCQi82ccgcJvjHdeYUw+H3qyBo0wUuIRvxANNOHVJkMlB7LmzRnXD06lzW+CDSswBj+xIDbny3FF0oXWVBE=----ATTACHMENT:----ODQ2NzczMzEwMjA1NTQ2MyAxODkzNDMyMjMxODM5NDMyIDQwMTI1MTIwNzc5NTI5MjQ=