Skip to content

Commit 7f6b560

Browse files
authored
Merge pull request #63174 from nextcloud/carl/command-adapter
feat(console): Expose raw Symfony OutputInterface and InputInterface
2 parents ea9495a + 4456ee9 commit 7f6b560

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

lib/private/Console/CommandAdapter.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,18 @@ public function execute(InputInterface $input, OutputInterface $output): int {
256256
continue;
257257
}
258258

259+
if ($type instanceof \ReflectionNamedType && $type->getName() === InputInterface::class) {
260+
// Not documented for some advanced usage
261+
$parameters[] = $input;
262+
continue;
263+
}
264+
265+
if ($type instanceof \ReflectionNamedType && $type->getName() === OutputInterface::class) {
266+
// Not documented for some advanced usage
267+
$parameters[] = $output;
268+
continue;
269+
}
270+
259271
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));
260272
}
261273

0 commit comments

Comments
 (0)