CommandInvoker
final class CommandInvoker (View source)
Executes a command inside a fresh command scope with invocation-specific services.
Methods
__construct(ScopeFactoryInterface $scopeFactory)
Creates an invoker backed by the application's scope factory.
Resolves and runs the selected command, always closing its scope afterward.
int
Details
__construct
__construct(ScopeFactoryInterface $scopeFactory)
Creates an invoker backed by the application's scope factory.
invoke
int
invoke(CommandDefinition $definition, array $argv, array $args, CommandOutput $output)
Resolves and runs the selected command, always closing its scope afterward.
Exceptions from command resolution or execution propagate after the scope is closed.