MiniAsset\Output\FreshTrait::isFresh PHP Метод

isFresh() публичный Метод

Fresh cached files have timestamps newer than all of the component files.
public isFresh ( AssetTarget $target ) : boolean
$target MiniAsset\AssetTarget The target file being built.
Результат boolean
    public function isFresh(AssetTarget $target)
    {
        $buildName = $this->buildFileName($target);
        $buildFile = $this->outputDir($target) . DIRECTORY_SEPARATOR . $buildName;
        if (!file_exists($buildFile)) {
            return false;
        }
        $buildTime = filemtime($buildFile);
        if ($this->configTime && $this->configTime >= $buildTime) {
            return false;
        }
        foreach ($target->files() as $file) {
            $time = $file->modifiedTime();
            if ($time === false || $time >= $buildTime) {
                return false;
            }
        }
        $filters = $this->filterRegistry->collection($target);
        foreach ($filters->filters() as $filter) {
            foreach ($filter->getDependencies($target) as $child) {
                $time = $child->modifiedTime();
                if ($time >= $buildTime) {
                    return false;
                }
            }
        }
        return true;
    }