Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PsrCachedReader.php

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\Annotations

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal