function PsrCachedReader::refresh
Used in debug mode to check if the cache is fresh.
Return value
bool Returns true if the cache was fresh, or false if the class being read was modified since writing to the cache.
1 call to PsrCachedReader::refresh()
- PsrCachedReader::fetchFromCache in vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ PsrCachedReader.php
File
-
vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ PsrCachedReader.php, line 168
Class
- PsrCachedReader
- A cache aware annotation reader.
Namespace
Doctrine\Common\AnnotationsCode
private function refresh(string $cacheKey, ReflectionClass $class) : bool {
$lastModification = $this->getLastModification($class);
if ($lastModification === 0) {
return true;
}
$item = $this->cache
->getItem('[C]' . $cacheKey);
if ($item->isHit() && $item->get() >= $lastModification) {
return true;
}
$this->cache
->save($item->set(time()));
return false;
}