public function run(
        ?string $command,
        $input = [],
        OutputInterface $output = null
    ): CommandOutput {
        if (is_array($input)) {
            $input = new ArrayInput($input + compact('command'));
        }
        $output = $output ?? new BufferedOutput();

        $command = $this->getApplication()->find($command);
        $code = ContainerScope::runScope($this->container, function () use (
            $command,
            $input,
            $output
        ) {
            return $command->run($input, $output);
        });

        return new CommandOutput($code ?? self::CODE_NONE, $output);
    }
public function run(
        ?string $command,
        $input = [],
        OutputInterface $output = null
    ): CommandOutput {
        if (is_array($input)) {
            $input = new ArrayInput($input + compact('command'));
        }
        $output = $output ?? new BufferedOutput();

        $command = $this->getApplication()->find($command);
        $code = ContainerScope::runScope($this->container, function () use (
            $command,
            $input,
            $output
        ) {
            return $command->run($input, $output);
        });

        return new CommandOutput($code ?? self::CODE_NONE, $output);
    }
public function run ( ? string $ command , $ input = [ ] , OutputInterface $ output = null ) : CommandOutput { if ( is_array ( $ input ) ) { $ input = new ArrayInput ( $ input + compact ( 'command' ) ) ; } $ output = $ output ?? new BufferedOutput ( ) ; $ command = $ this -> getApplication ( ) -> find ( $ command ) ; $ code = ContainerScope :: runScope ( $ this -> container , function ( ) use ( $ command , $ input , $ output ) { return $ command -> run ( $ input , $ output ) ; } ) ; return new CommandOutput ( $ code ?? self :: CODE_NONE , $ output ) ; }
Run selected command.

@param string               $command
@param InputInterface|array $input
@param OutputInterface|null $output
@return CommandOutput

@throws \Throwable
@throws CommandNotFoundException
Run selected command .