original_string: public function scanPlugin($plugin)
      {
          if (!Plugin::isLoaded($plugin)) {
              return [];
          }
          $path = Plugin::classPath($plugin);
          $namespace = str_replace('/', '\\', $plugin);
          $prefix = Inflector::underscore($plugin) . '.';
  
          $commands = $this->scanDir($path . 'Command', $namespace . '\Command\\', $prefix, []);
          $shells = $this->scanDir($path . 'Shell', $namespace . '\Shell\\', $prefix, []);
  
          return array_merge($shells, $commands);
      }
code: public function scanPlugin($plugin)
      {
          if (!Plugin::isLoaded($plugin)) {
              return [];
          }
          $path = Plugin::classPath($plugin);
          $namespace = str_replace('/', '\\', $plugin);
          $prefix = Inflector::underscore($plugin) . '.';
  
          $commands = $this->scanDir($path . 'Command', $namespace . '\Command\\', $prefix, []);
          $shells = $this->scanDir($path . 'Shell', $namespace . '\Shell\\', $prefix, []);
  
          return array_merge($shells, $commands);
      }
code_tokens: public function scanPlugin ( $ plugin ) { if ( ! Plugin :: isLoaded ( $ plugin ) ) { return [ ] ; } $ path = Plugin :: classPath ( $ plugin ) ; $ namespace = str_replace ( '/' , '\\' , $ plugin ) ; $ prefix = Inflector :: underscore ( $ plugin ) . '.' ; $ commands = $ this -> scanDir ( $ path . 'Command' , $ namespace . '\Command\\' , $ prefix , [ ] ) ; $ shells = $ this -> scanDir ( $ path . 'Shell' , $ namespace . '\Shell\\' , $ prefix , [ ] ) ; return array_merge ( $ shells , $ commands ) ; }
docstring: Scan the named plugin for shells and commands
  
  @param string $plugin The named plugin.
  @return array A list of command metadata.
docstring_tokens: Scan the named plugin for shells and commands