From af9f6a4b579d734aaa65c13697f8ce6c246bd68b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 13 Nov 2024 12:15:32 +0100 Subject: [PATCH] Revert "Do not boot the kernel when using composer command" This reverts commit b5a2093ac81cb5b829eefce3b34d8d47411a08df. We need to boot the kernel, because one could create a custom composer task. --- src/Console/Application.php | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/Console/Application.php b/src/Console/Application.php index 342ab38d..e4cc2cba 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -2,12 +2,10 @@ namespace Castor\Console; -use Castor\Console\Command\ComposerCommand; use Castor\Container; use Castor\Kernel; use Symfony\Component\Console\Application as SymfonyApplication; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -45,9 +43,7 @@ public function doRun(InputInterface $input, OutputInterface $output): int // @phpstan-ignore-next-line Container::set($this->containerBuilder->get(Container::class)); - if ($this->shouldBootKernel($input)) { - $this->kernel->boot($input, $output); - } + $this->kernel->boot($input, $output); return parent::doRun($input, $output); } @@ -89,26 +85,6 @@ protected function getDefaultInputDefinition(): InputDefinition return $definition; } - private function shouldBootKernel(InputInterface $input): bool - { - $name = $input->getFirstArgument(); - if (!$name) { - return true; - } - - try { - $command = $this->find($name); - } catch (CommandNotFoundException) { - return true; - } - - if ($command instanceof ComposerCommand) { - return false; - } - - return true; - } - private function getLogo(): string { if (!($_SERVER['CASTOR_TEST'] ?? false)) {