From 4456ee95f0fc0926fe538017fb3e18a72ec3eae7 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Wed, 12 Aug 2026 10:48:32 +0200 Subject: [PATCH] feat(console): Expose raw Symfony OutputInterface and InputInterface This is not documented but helps with porting help in e.g. the fulltextsearch app which does quite complex stuff with multiple progress bar. Signed-off-by: Carl Schwan --- lib/private/Console/CommandAdapter.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/private/Console/CommandAdapter.php b/lib/private/Console/CommandAdapter.php index c8809fcb2288f..089c62e789557 100644 --- a/lib/private/Console/CommandAdapter.php +++ b/lib/private/Console/CommandAdapter.php @@ -256,6 +256,18 @@ public function execute(InputInterface $input, OutputInterface $output): int { continue; } + if ($type instanceof \ReflectionNamedType && $type->getName() === InputInterface::class) { + // Not documented for some advanced usage + $parameters[] = $input; + continue; + } + + if ($type instanceof \ReflectionNamedType && $type->getName() === OutputInterface::class) { + // Not documented for some advanced usage + $parameters[] = $output; + continue; + } + throw new \LogicException(\sprintf('Unable to resolve parameter "$%s" of "%s": it is neither an #[Argument], an #[Option], nor an %s, %s, %s or %s.', $name, $this->reflectionMethod->getName(), IOutput::class, IInput::class, ISignalHandler::class, OutputFormat::class)); }