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

Breadcrumb

  1. Drupal Core 11.1.x

AnnotationRegistry.php

Namespace

Doctrine\Common\Annotations

File

vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php

View source
<?php

namespace Doctrine\Common\Annotations;

use function array_key_exists;
use function class_exists;
final class AnnotationRegistry {
    
    /**
     * An array of classes which cannot be found
     *
     * @var null[] indexed by class name
     */
    private static $failedToAutoload = [];
    public static function reset() : void {
        self::$failedToAutoload = [];
    }
    
    /**
     * Autoloads an annotation class silently.
     */
    public static function loadAnnotationClass(string $class) : bool {
        if (class_exists($class, false)) {
            return true;
        }
        if (array_key_exists($class, self::$failedToAutoload)) {
            return false;
        }
        if (class_exists($class)) {
            return true;
        }
        self::$failedToAutoload[$class] = null;
        return false;
    }

}

Classes

Title Deprecated Summary
AnnotationRegistry

API Navigation

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