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)); }