src/Phug/Optimizer.php
public function isExpired($file, &$cachePath = null)
    {
        if (isset($this->options['up_to_date_check']) && !$this->options['up_to_date_check']) {
            return false;
        }

        if (!$this->cacheDirectory) {
            return true;
        }

        $sourcePath = $this->resolve($file);
        $cachePath = rtrim($this->cacheDirectory, '\\/').DIRECTORY_SEPARATOR.$this->hashPrint($sourcePath).'.php';

        if (!file_exists($cachePath)) {
            return true;
        }

        return $this->hasExpiredImport($sourcePath, $cachePath);
    }
public function isExpired($file, &$cachePath = null)
    {
        if (isset($this->options['up_to_date_check']) && !$this->options['up_to_date_check']) {
            return false;
        }

        if (!$this->cacheDirectory) {
            return true;
        }

        $sourcePath = $this->resolve($file);
        $cachePath = rtrim($this->cacheDirectory, '\\/').DIRECTORY_SEPARATOR.$this->hashPrint($sourcePath).'.php';

        if (!file_exists($cachePath)) {
            return true;
        }

        return $this->hasExpiredImport($sourcePath, $cachePath);
    }
Returns true is a template file is expired, false else.
$cachePath will be set with the template cache file path.

@param string $file
@param string &$cachePath

@return bool