You are here

public static function AnnotationRegistry::registerLoader in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php \Doctrine\Common\Annotations\AnnotationRegistry::registerLoader()

Registers an autoloading callable for annotations, much like spl_autoload_register().

NOTE: These class loaders HAVE to be silent when a class was not found! IMPORTANT: Loaders have to return true if they loaded a class that could contain the searched annotation class.

Parameters

callable $callable:

Return value

void

Throws

\InvalidArgumentException

1 call to AnnotationRegistry::registerLoader()
AnnotatedClassDiscovery::getDefinitions in core/lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php
Gets the definition of all plugins for this type.

File

vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php, line 108

Class

AnnotationRegistry
AnnotationRegistry.

Namespace

Doctrine\Common\Annotations

Code

public static function registerLoader($callable) {
  if (!is_callable($callable)) {
    throw new \InvalidArgumentException("A callable is expected in AnnotationRegistry::registerLoader().");
  }
  self::$loaders[] = $callable;
}