From aecf830211e899cefaeb1404e28365b6af04331c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 13 Sep 2023 16:59:26 +0800 Subject: [PATCH] eee --- kiri-engine/Application.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kiri-engine/Application.php b/kiri-engine/Application.php index fa2969d5..eaa37ef4 100644 --- a/kiri-engine/Application.php +++ b/kiri-engine/Application.php @@ -19,7 +19,11 @@ use Kiri\Events\{OnAfterCommandExecute, OnBeforeCommandExecute}; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; use ReflectionException; -use Symfony\Component\Console\{Application as ConsoleApplication, Input\ArgvInput, Output\ConsoleOutput, Output\OutputInterface}; +use Symfony\Component\Console\{Application as ConsoleApplication, + Exception\ExceptionInterface, + Input\ArgvInput, + Output\ConsoleOutput, + Output\OutputInterface}; use Kiri\Server\Events\OnWorkerStart; /** @@ -140,7 +144,7 @@ class Application extends BaseApplication * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface * @throws ReflectionException - * @throws Exception + * @throws Exception|ExceptionInterface */ public function execute(array $argv): void { @@ -151,7 +155,7 @@ class Application extends BaseApplication $this->container->bind(OutputInterface::class, $output); $console = $this->container->get(ConsoleApplication::class); - $command = $console->find($input->getFirstArgument()); + $command = $console->find($input->getFirstArgument() ?? 'list'); fire(new OnBeforeCommandExecute($command));