You are here

public static function AnnotationRegistry::registerLoader in Plug 7

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 lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php
Gets the definition of all plugins for this type.

File

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