src/Kunstmaan/TranslatorBundle/Service/Translator/CacheValidator.php
public function getOldestCachefileDate()
    {
        if (!is_dir($this->cacheDir)) {
            return null;
        }

        $finder = new Finder();
        $finder->files()
            ->name('catalogue*.php')
            ->sortByModifiedTime()
            ->in($this->cacheDir);

        foreach ($finder as $file) {
            $date = new \DateTime();
            $date->setTimestamp($file->getMTime());

            return $date;
        }

        return null;
    }
public function getOldestCachefileDate()
    {
        if (!is_dir($this->cacheDir)) {
            return null;
        }

        $finder = new Finder();
        $finder->files()
            ->name('catalogue*.php')
            ->sortByModifiedTime()
            ->in($this->cacheDir);

        foreach ($finder as $file) {
            $date = new \DateTime();
            $date->setTimestamp($file->getMTime());

            return $date;
        }

        return null;
    }
public function getOldestCachefileDate ( ) { if ( ! is_dir ( $ this -> cacheDir ) ) { return null ; } $ finder = new Finder ( ) ; $ finder -> files ( ) -> name ( 'catalogue*.php' ) -> sortByModifiedTime ( ) -> in ( $ this -> cacheDir ) ; foreach ( $ finder as $ file ) { $ date = new \ DateTime ( ) ; $ date -> setTimestamp ( $ file -> getMTime ( ) ) ; return $ date ; } return null ; }
Retrieve a Datetime of the oldest cache file made

@return DateTime mtime of oldest cache file
Retrieve a Datetime of the oldest cache file made