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

Breadcrumb

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

function PsrCachedReader::getTraitLastModificationTime

1 call to PsrCachedReader::getTraitLastModificationTime()
PsrCachedReader::getLastModification in vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php
Returns the time the class was last modified, testing traits and parents

File

vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php, line 214

Class

PsrCachedReader
A cache aware annotation reader.

Namespace

Doctrine\Common\Annotations

Code

private function getTraitLastModificationTime(ReflectionClass $reflectionTrait) : int {
    $fileName = $reflectionTrait->getFileName();
    if (isset($this->loadedFilemtimes[$fileName])) {
        return $this->loadedFilemtimes[$fileName];
    }
    $lastModificationTime = max(array_merge([
        $fileName !== false && is_file($fileName) ? filemtime($fileName) : 0,
    ], array_map(function (ReflectionClass $reflectionTrait) : int {
        return $this->getTraitLastModificationTime($reflectionTrait);
    }, $reflectionTrait->getTraits())));
    assert($lastModificationTime !== false);
    return $this->loadedFilemtimes[$fileName] = $lastModificationTime;
}

API Navigation

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