original_string: protected function removeDirectory($path)
      {
          $files = glob($path . '/*');
          foreach ($files as $file) {
              if (is_dir($file)) {
                  static::removeDirectory($file);
              } else if (basename($file) !== '.gitignore') {
                  unlink($file);
              }
          }
          if ($path !== $this->cacheRoot) {
              rmdir($path);
          }
  
          return;
      }
code: protected function removeDirectory($path)
      {
          $files = glob($path . '/*');
          foreach ($files as $file) {
              if (is_dir($file)) {
                  static::removeDirectory($file);
              } else if (basename($file) !== '.gitignore') {
                  unlink($file);
              }
          }
          if ($path !== $this->cacheRoot) {
              rmdir($path);
          }
  
          return;
      }
code_tokens: protected function removeDirectory ( $ path ) { $ files = glob ( $ path . '/*' ) ; foreach ( $ files as $ file ) { if ( is_dir ( $ file ) ) { static :: removeDirectory ( $ file ) ; } else if ( basename ( $ file ) !== '.gitignore' ) { unlink ( $ file ) ; } } if ( $ path !== $ this -> cacheRoot ) { rmdir ( $ path ) ; } return ; }
docstring: Removes directories recursively.
  
  @param $path
docstring_tokens: Removes directories recursively .