protected function getShell(ConsoleIo $io, CommandCollection $commands, $name)
    {
        $instance = $commands->get($name);
        if (is_string($instance)) {
            $instance = $this->createShell($instance, $io);
        }
        if ($instance instanceof Shell) {
            $instance->setRootName($this->root);
        }
        if ($instance instanceof Command) {
            $instance->setName("{$this->root} {$name}");
        }
        if ($instance instanceof CommandCollectionAwareInterface) {
            $instance->setCommandCollection($commands);
        }

        return $instance;
    }
protected function getShell(ConsoleIo $io, CommandCollection $commands, $name)
    {
        $instance = $commands->get($name);
        if (is_string($instance)) {
            $instance = $this->createShell($instance, $io);
        }
        if ($instance instanceof Shell) {
            $instance->setRootName($this->root);
        }
        if ($instance instanceof Command) {
            $instance->setName("{$this->root} {$name}");
        }
        if ($instance instanceof CommandCollectionAwareInterface) {
            $instance->setCommandCollection($commands);
        }

        return $instance;
    }
protected function getShell ( ConsoleIo $ io , CommandCollection $ commands , $ name ) { $ instance = $ commands -> get ( $ name ) ; if ( is_string ( $ instance ) ) { $ instance = $ this -> createShell ( $ instance , $ io ) ; } if ( $ instance instanceof Shell ) { $ instance -> setRootName ( $ this -> root ) ; } if ( $ instance instanceof Command ) { $ instance -> setName ( "{$this->root} {$name}" ) ; } if ( $ instance instanceof CommandCollectionAwareInterface ) { $ instance -> setCommandCollection ( $ commands ) ; } return $ instance ; }
Get the shell instance for a given command name

@param \Cake\Console\ConsoleIo $io The IO wrapper for the created shell class.
@param \Cake\Console\CommandCollection $commands The command collection to find the shell in.
@param string $name The command name to find
@return \Cake\Console\Shell|\Cake\Console\Command
Get the shell instance for a given command name