original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Get the shell instance for a given command name