function AnnotationRegistry::loadAnnotationClass

Autoload an annotation class silently.

1 call to AnnotationRegistry::loadAnnotationClass()
DocParser::classExists in core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php
Attempts to check if a class exists or not. This never goes through the PHP autoloading mechanism but uses the {@link AnnotationRegistry} to load classes.

File

core/lib/Drupal/Component/Annotation/Doctrine/AnnotationRegistry.php, line 48

Class

AnnotationRegistry

Namespace

Drupal\Component\Annotation\Doctrine

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.