/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Console/Exception/RunCommandFailedException.php
29 строк
883 B
Martin Komischke
[Console] fall back to 0 when getCode() does not provide an integer
30 янв 2026, 11:17
30 янв 2026, 11:17
f27f48f
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Exception; use Symfony\Component\Console\Messenger\RunCommandContext; /** * @author Kevin Bond <kevinbond@gmail.com> */ final class RunCommandFailedException extends RuntimeException { public function __construct(\Throwable|string $exception, public readonly RunCommandContext $context) { parent::__construct( $exception instanceof \Throwable ? $exception->getMessage() : $exception, $exception instanceof \Throwable && \is_int($exception->getCode()) ? $exception->getCode() : 0, $exception instanceof \Throwable ? $exception : null, ); } }