original_string: public function expandDirectories($baseDir) {
          $directories = array();
          foreach (scandir($baseDir) as $file) {
              if ($file == '.' || $file == '..')
                  continue;
              $dir = $baseDir . DS . $file;
              if (is_dir($dir)) {
                  $directories [] = $dir;
                  $directories = array_merge($directories, $this->expandDirectories($dir));
              }
          }
          return $directories;
      }
code: public function expandDirectories($baseDir) {
          $directories = array();
          foreach (scandir($baseDir) as $file) {
              if ($file == '.' || $file == '..')
                  continue;
              $dir = $baseDir . DS . $file;
              if (is_dir($dir)) {
                  $directories [] = $dir;
                  $directories = array_merge($directories, $this->expandDirectories($dir));
              }
          }
          return $directories;
      }
code_tokens: public function expandDirectories ( $ baseDir ) { $ directories = array ( ) ; foreach ( scandir ( $ baseDir ) as $ file ) { if ( $ file == '.' || $ file == '..' ) continue ; $ dir = $ baseDir . DS . $ file ; if ( is_dir ( $ dir ) ) { $ directories [ ] = $ dir ; $ directories = array_merge ( $ directories , $ this -> expandDirectories ( $ dir ) ) ; } } return $ directories ; }
docstring: Recursive function that returns all directories inside a base directory.
  
  @param string $baseDir
  @return array
docstring_tokens: Recursive function that returns all directories inside a base directory .