original_string: public function findShell($shell)
      {
          $className = $this->_shellExists($shell);
          if (!$className) {
              $shell = $this->_handleAlias($shell);
              $className = $this->_shellExists($shell);
          }
  
          if (!$className) {
              throw new MissingShellException([
                  'class' => $shell,
              ]);
          }
  
          return $this->_createShell($className, $shell);
      }
code: public function findShell($shell)
      {
          $className = $this->_shellExists($shell);
          if (!$className) {
              $shell = $this->_handleAlias($shell);
              $className = $this->_shellExists($shell);
          }
  
          if (!$className) {
              throw new MissingShellException([
                  'class' => $shell,
              ]);
          }
  
          return $this->_createShell($className, $shell);
      }
code_tokens: public function findShell ( $ shell ) { $ className = $ this -> _shellExists ( $ shell ) ; if ( ! $ className ) { $ shell = $ this -> _handleAlias ( $ shell ) ; $ className = $ this -> _shellExists ( $ shell ) ; } if ( ! $ className ) { throw new MissingShellException ( [ 'class' => $ shell , ] ) ; } return $ this -> _createShell ( $ className , $ shell ) ; }
docstring: Get shell to use, either plugin shell or application shell
  
  All paths in the loaded shell paths are searched, handles alias
  dereferencing
  
  @param string $shell Optionally the name of a plugin
  @return \Cake\Console\Shell A shell instance.
  @throws \Cake\Console\Exception\MissingShellException when errors are encountered.
docstring_tokens: Get shell to use either plugin shell or application shell