class AnnotationDirectoryLoader extends AnnotationFileLoader

AnnotationDirectoryLoader loads routing information from annotations set on PHP classes and methods.

Methods

getResolver()

Gets the loader resolver.

from Loader
setResolver(LoaderResolverInterface $resolver)

Sets the loader resolver.

from Loader
mixed
import(mixed $resource, string $type = null, Boolean $ignoreErrors = false, string $sourceResource = null)

Imports a resource.

resolve(mixed $resource, string $type = null)

Finds a loader able to load an imported resource.

from Loader
__construct(FileLocatorInterface $locator, AnnotationClassLoader $loader, string|array $paths = array())

Constructor.

setCurrentDir($dir)

No description

getLocator()

No description

load(string $path, string $type = null)

Loads from annotations from a directory.

Boolean
supports(mixed $resource, string $type = null)

Returns true if this class supports the given resource.

Details

in Loader at line line 30
LoaderResolverInterface getResolver()

Gets the loader resolver.

Return Value

LoaderResolverInterface A LoaderResolverInterface instance

in Loader at line line 40
setResolver(LoaderResolverInterface $resolver)

Sets the loader resolver.

Parameters

LoaderResolverInterface $resolver A LoaderResolverInterface instance

in FileLoader at line line 64
mixed import(mixed $resource, string $type = null, Boolean $ignoreErrors = false, string $sourceResource = null)

Imports a resource.

Parameters

mixed $resource A Resource
string $type The resource type
Boolean $ignoreErrors Whether to ignore import errors or not
string $sourceResource The original resource importing the new resource

Return Value

mixed

Exceptions

FileLoaderLoadException
FileLoaderImportCircularReferenceException

in Loader at line line 68
LoaderInterface resolve(mixed $resource, string $type = null)

Finds a loader able to load an imported resource.

Parameters

mixed $resource A Resource
string $type The resource type

Return Value

LoaderInterface A LoaderInterface instance

Exceptions

FileLoaderLoadException if no loader is found

in AnnotationFileLoader at line line 38
__construct(FileLocatorInterface $locator, AnnotationClassLoader $loader, string|array $paths = array())

Constructor.

Parameters

FileLocatorInterface $locator A FileLocatorInterface instance
AnnotationClassLoader $loader An AnnotationClassLoader instance
string|array $paths A path or an array of paths where to look for resources

Exceptions

RuntimeException

in FileLoader at line line 41
setCurrentDir($dir)

Parameters

$dir

in FileLoader at line line 46
getLocator()

at line line 35
load(string $path, string $type = null)

Loads from annotations from a directory.

Parameters

string $path A directory path
string $type The resource type

Exceptions

InvalidArgumentException When the directory does not exist or its routes cannot be parsed

at line line 67
Boolean supports(mixed $resource, string $type = null)

Returns true if this class supports the given resource.

Parameters

mixed $resource A resource
string $type The resource type

Return Value

Boolean true if this class supports the given resource, false otherwise