original_string: public function purgeOldCache()
      {
          $cache_dir = dirname($this->cache_dir);
          $current = basename($this->cache_dir);
          $count = 0;
  
          foreach (new \DirectoryIterator($cache_dir) as $file) {
              $dir = $file->getBasename();
              if ($dir === $current || $file->isDot() || $file->isFile()) {
                  continue;
              }
  
              Folder::delete($file->getPathname());
              $count++;
          }
  
          return $count;
      }
code: public function purgeOldCache()
      {
          $cache_dir = dirname($this->cache_dir);
          $current = basename($this->cache_dir);
          $count = 0;
  
          foreach (new \DirectoryIterator($cache_dir) as $file) {
              $dir = $file->getBasename();
              if ($dir === $current || $file->isDot() || $file->isFile()) {
                  continue;
              }
  
              Folder::delete($file->getPathname());
              $count++;
          }
  
          return $count;
      }
code_tokens: public function purgeOldCache ( ) { $ cache_dir = dirname ( $ this -> cache_dir ) ; $ current = basename ( $ this -> cache_dir ) ; $ count = 0 ; foreach ( new \ DirectoryIterator ( $ cache_dir ) as $ file ) { $ dir = $ file -> getBasename ( ) ; if ( $ dir === $ current || $ file -> isDot ( ) || $ file -> isFile ( ) ) { continue ; } Folder :: delete ( $ file -> getPathname ( ) ) ; $ count ++ ; } return $ count ; }
docstring: Deletes the old out of date file-based caches
  
  @return int
docstring_tokens: Deletes the old out of date file - based caches