original_string: public function getControllersForApp()
      {
          $controllers = [];
          $ctrlFolder = new Folder();
  
          /** @var Folder $ctrlFolder */
          $ctrlFolder->cd(ROOT . DS . 'src' . DS . 'Controller');
  
          if (!empty($ctrlFolder)) {
              $files = $ctrlFolder->find('.*Controller\.php$');
              $subLength = strlen('Controller.php');
              foreach ($files as $f) {
                  $filename = basename($f);
                  if ($filename === 'AppController.php') {
                      continue;
                  }
                  $ctrlName = substr($filename, 0, strlen($filename) - $subLength);
                  $controllers[] = [
                      'name' => $ctrlName,
                      'path' => $ctrlFolder->path . DS . $f
                  ];
              }
              $subFolders = $ctrlFolder->read(true, false, true)[0];
              foreach ($subFolders as $subFolder) {
                  $ctrlFolder->cd($subFolder);
                  $files = $ctrlFolder->find('.*Controller\.php$');
                  $subLength = strlen('Controller.php');
                  foreach ($files as $f) {
                      $filename = basename($f);
                      if ($filename === 'AppController.php') {
                          continue;
                      }
                      $ctrlName = substr($filename, 0, strlen($filename) - $subLength);
                      $controllers[] = [
                          'name' => $ctrlName,
                          'path' => $ctrlFolder->path . DS . $f
                      ];
                  }
              }
          }
  
          return $controllers;
      }
code: public function getControllersForApp()
      {
          $controllers = [];
          $ctrlFolder = new Folder();
  
          /** @var Folder $ctrlFolder */
          $ctrlFolder->cd(ROOT . DS . 'src' . DS . 'Controller');
  
          if (!empty($ctrlFolder)) {
              $files = $ctrlFolder->find('.*Controller\.php$');
              $subLength = strlen('Controller.php');
              foreach ($files as $f) {
                  $filename = basename($f);
                  if ($filename === 'AppController.php') {
                      continue;
                  }
                  $ctrlName = substr($filename, 0, strlen($filename) - $subLength);
                  $controllers[] = [
                      'name' => $ctrlName,
                      'path' => $ctrlFolder->path . DS . $f
                  ];
              }
              $subFolders = $ctrlFolder->read(true, false, true)[0];
              foreach ($subFolders as $subFolder) {
                  $ctrlFolder->cd($subFolder);
                  $files = $ctrlFolder->find('.*Controller\.php$');
                  $subLength = strlen('Controller.php');
                  foreach ($files as $f) {
                      $filename = basename($f);
                      if ($filename === 'AppController.php') {
                          continue;
                      }
                      $ctrlName = substr($filename, 0, strlen($filename) - $subLength);
                      $controllers[] = [
                          'name' => $ctrlName,
                          'path' => $ctrlFolder->path . DS . $f
                      ];
                  }
              }
          }
  
          return $controllers;
      }
code_tokens: public function getControllersForApp ( ) { $ controllers = [ ] ; $ ctrlFolder = new Folder ( ) ; /** @var Folder $ctrlFolder */ $ ctrlFolder -> cd ( ROOT . DS . 'src' . DS . 'Controller' ) ; if ( ! empty ( $ ctrlFolder ) ) { $ files = $ ctrlFolder -> find ( '.*Controller\.php$' ) ; $ subLength = strlen ( 'Controller.php' ) ; foreach ( $ files as $ f ) { $ filename = basename ( $ f ) ; if ( $ filename === 'AppController.php' ) { continue ; } $ ctrlName = substr ( $ filename , 0 , strlen ( $ filename ) - $ subLength ) ; $ controllers [ ] = [ 'name' => $ ctrlName , 'path' => $ ctrlFolder -> path . DS . $ f ] ; } $ subFolders = $ ctrlFolder -> read ( true , false , true ) [ 0 ] ; foreach ( $ subFolders as $ subFolder ) { $ ctrlFolder -> cd ( $ subFolder ) ; $ files = $ ctrlFolder -> find ( '.*Controller\.php$' ) ; $ subLength = strlen ( 'Controller.php' ) ; foreach ( $ files as $ f ) { $ filename = basename ( $ f ) ; if ( $ filename === 'AppController.php' ) { continue ; } $ ctrlName = substr ( $ filename , 0 , strlen ( $ filename ) - $ subLength ) ; $ controllers [ ] = [ 'name' => $ ctrlName , 'path' => $ ctrlFolder -> path . DS . $ f ] ; } } } return $ controllers ; }
docstring: Retrieve all controller names + paths for the app src.
  
  @return array
docstring_tokens: Retrieve all controller names + paths for the app src .