original_string: public function getControllersForPlugin($plugin, $pluginPath)
      {
          $controllers = [];
          $Folder = new Folder();
  
          $ctrlFolder = $Folder->cd($pluginPath . DS . 'src' . DS . 'Controller');
  
          if (!empty($ctrlFolder)) {
              $files = $Folder->find('.*Controller\.php$');
              $subLength = strlen('Controller.php');
              foreach ($files as $f) {
                  $filename = basename($f);
                  if ($filename === $plugin . 'AppController.php') {
                      continue;
                  }
                  $ctrlName = substr($filename, 0, strlen($filename) - $subLength);
                  $controllers[] = [
                      'name' => $ctrlName,
                      'path' => $Folder->path . DS . $f
                  ];
              }
          }
  
          return $controllers;
      }
code: public function getControllersForPlugin($plugin, $pluginPath)
      {
          $controllers = [];
          $Folder = new Folder();
  
          $ctrlFolder = $Folder->cd($pluginPath . DS . 'src' . DS . 'Controller');
  
          if (!empty($ctrlFolder)) {
              $files = $Folder->find('.*Controller\.php$');
              $subLength = strlen('Controller.php');
              foreach ($files as $f) {
                  $filename = basename($f);
                  if ($filename === $plugin . 'AppController.php') {
                      continue;
                  }
                  $ctrlName = substr($filename, 0, strlen($filename) - $subLength);
                  $controllers[] = [
                      'name' => $ctrlName,
                      'path' => $Folder->path . DS . $f
                  ];
              }
          }
  
          return $controllers;
      }
code_tokens: public function getControllersForPlugin ( $ plugin , $ pluginPath ) { $ controllers = [ ] ; $ Folder = new Folder ( ) ; $ ctrlFolder = $ Folder -> cd ( $ pluginPath . DS . 'src' . DS . 'Controller' ) ; if ( ! empty ( $ ctrlFolder ) ) { $ files = $ Folder -> find ( '.*Controller\.php$' ) ; $ subLength = strlen ( 'Controller.php' ) ; foreach ( $ files as $ f ) { $ filename = basename ( $ f ) ; if ( $ filename === $ plugin . 'AppController.php' ) { continue ; } $ ctrlName = substr ( $ filename , 0 , strlen ( $ filename ) - $ subLength ) ; $ controllers [ ] = [ 'name' => $ ctrlName , 'path' => $ Folder -> path . DS . $ f ] ; } } return $ controllers ; }
docstring: Retrieve all controller names + paths for a given plugin.
  
  @param string $plugin The name of the plugin.
  @param string $pluginPath The path of the plugin.
  @return array
  @todo: Refactor https://scrutinizer-ci.com/g/wasabi-cms/core/indices/834500/duplications/543470
docstring_tokens: Retrieve all controller names + paths for a given plugin .