original_string: public function getShell($commandName)
      {
          list($pluginDot, $name) = pluginSplit($commandName, true);
  
          if (in_array(strtolower($pluginDot), ['app.', 'core.'])) {
              $commandName = $name;
              $pluginDot = '';
          }
  
          if (!in_array($commandName, $this->commands()) && (empty($pluginDot) && !in_array($name, $this->commands()))) {
              return false;
          }
  
          if (empty($pluginDot)) {
              $shellList = $this->getShellList();
  
              if (!in_array($commandName, $shellList['app']) && !in_array($commandName, $shellList['CORE'])) {
                  unset($shellList['CORE'], $shellList['app']);
                  foreach ($shellList as $plugin => $commands) {
                      if (in_array($commandName, $commands)) {
                          $pluginDot = $plugin . '.';
                          break;
                      }
                  }
              }
          }
  
          $name = Inflector::camelize($name);
          $pluginDot = Inflector::camelize($pluginDot);
          $class = App::className($pluginDot . $name, 'Shell', 'Shell');
          if (!$class) {
              return false;
          }
  
          /* @var \Cake\Console\Shell $Shell */
          $Shell = new $class();
          $Shell->plugin = trim($pluginDot, '.');
          $Shell->initialize();
  
          return $Shell;
      }
code: public function getShell($commandName)
      {
          list($pluginDot, $name) = pluginSplit($commandName, true);
  
          if (in_array(strtolower($pluginDot), ['app.', 'core.'])) {
              $commandName = $name;
              $pluginDot = '';
          }
  
          if (!in_array($commandName, $this->commands()) && (empty($pluginDot) && !in_array($name, $this->commands()))) {
              return false;
          }
  
          if (empty($pluginDot)) {
              $shellList = $this->getShellList();
  
              if (!in_array($commandName, $shellList['app']) && !in_array($commandName, $shellList['CORE'])) {
                  unset($shellList['CORE'], $shellList['app']);
                  foreach ($shellList as $plugin => $commands) {
                      if (in_array($commandName, $commands)) {
                          $pluginDot = $plugin . '.';
                          break;
                      }
                  }
              }
          }
  
          $name = Inflector::camelize($name);
          $pluginDot = Inflector::camelize($pluginDot);
          $class = App::className($pluginDot . $name, 'Shell', 'Shell');
          if (!$class) {
              return false;
          }
  
          /* @var \Cake\Console\Shell $Shell */
          $Shell = new $class();
          $Shell->plugin = trim($pluginDot, '.');
          $Shell->initialize();
  
          return $Shell;
      }
code_tokens: public function getShell ( $ commandName ) { list ( $ pluginDot , $ name ) = pluginSplit ( $ commandName , true ) ; if ( in_array ( strtolower ( $ pluginDot ) , [ 'app.' , 'core.' ] ) ) { $ commandName = $ name ; $ pluginDot = '' ; } if ( ! in_array ( $ commandName , $ this -> commands ( ) ) && ( empty ( $ pluginDot ) && ! in_array ( $ name , $ this -> commands ( ) ) ) ) { return false ; } if ( empty ( $ pluginDot ) ) { $ shellList = $ this -> getShellList ( ) ; if ( ! in_array ( $ commandName , $ shellList [ 'app' ] ) && ! in_array ( $ commandName , $ shellList [ 'CORE' ] ) ) { unset ( $ shellList [ 'CORE' ] , $ shellList [ 'app' ] ) ; foreach ( $ shellList as $ plugin => $ commands ) { if ( in_array ( $ commandName , $ commands ) ) { $ pluginDot = $ plugin . '.' ; break ; } } } } $ name = Inflector :: camelize ( $ name ) ; $ pluginDot = Inflector :: camelize ( $ pluginDot ) ; $ class = App :: className ( $ pluginDot . $ name , 'Shell' , 'Shell' ) ; if ( ! $ class ) { return false ; } /* @var \Cake\Console\Shell $Shell */ $ Shell = new $ class ( ) ; $ Shell -> plugin = trim ( $ pluginDot , '.' ) ; $ Shell -> initialize ( ) ; return $ Shell ; }
docstring: Get Shell instance for the given command
  
  @param string $commandName The command you want.
  @return \Cake\Console\Shell|bool Shell instance if the command can be found, false otherwise.
docstring_tokens: Get Shell instance for the given command