function PsrCachedReader::getLastModification
Returns the time the class was last modified, testing traits and parents
1 call to PsrCachedReader::getLastModification()
- PsrCachedReader::refresh in vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ PsrCachedReader.php - Used in debug mode to check if the cache is fresh.
File
-
vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ PsrCachedReader.php, line 188
Class
- PsrCachedReader
- A cache aware annotation reader.
Namespace
Doctrine\Common\AnnotationsCode
private function getLastModification(ReflectionClass $class) : int {
$filename = $class->getFileName();
if (isset($this->loadedFilemtimes[$filename])) {
return $this->loadedFilemtimes[$filename];
}
$parent = $class->getParentClass();
$lastModification = max(array_merge([
$filename !== false && is_file($filename) ? filemtime($filename) : 0,
], array_map(function (ReflectionClass $reflectionTrait) : int {
return $this->getTraitLastModificationTime($reflectionTrait);
}, $class->getTraits()), array_map(function (ReflectionClass $class) : int {
return $this->getLastModification($class);
}, $class->getInterfaces()), $parent ? [
$this->getLastModification($parent),
] : []));
assert($lastModification !== false);
return $this->loadedFilemtimes[$filename] = $lastModification;
}