AttributeDirectoryLoader
extends AttributeFileLoader
in package
AttributeDirectoryLoader loads routing information from attributes set on PHP classes and methods.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- getLocator() : FileLocatorInterface
- Returns the file locator used by this loader.
- getResolver() : LoaderResolverInterface
- Gets the loader resolver.
- import() : mixed
- Imports a resource.
- load() : mixed
- Loads from attributes from a file.
- resolve() : LoaderInterface
- Finds a loader able to load an imported resource.
- setCurrentDir() : void
- Sets the current directory.
- setResolver() : void
- Sets the loader resolver.
- supports() : bool
- Returns whether this class supports the given resource.
- findClass() : string|false
- Returns the full class name for the first class in the file.
Properties
$env
protected
mixed
$env
$loader
protected
mixed
$loader
$loading
protected
static mixed
$loading
= []
$locator
protected
mixed
$locator
$resolver
protected
mixed
$resolver
Methods
__construct()
public
__construct(FileLocatorInterface $locator, AttributeClassLoader $loader) : mixed
Parameters
- $locator : FileLocatorInterface
- $loader : AttributeClassLoader
getLocator()
Returns the file locator used by this loader.
public
getLocator() : FileLocatorInterface
Return values
FileLocatorInterfacegetResolver()
Gets the loader resolver.
public
getResolver() : LoaderResolverInterface
Return values
LoaderResolverInterfaceimport()
Imports a resource.
public
import(mixed $resource[, string|null $type = null ][, bool $ignoreErrors = false ][, string|null $sourceResource = null ][, string|array<string|int, string>|null $exclude = null ]) : mixed
Parameters
- $resource : mixed
-
A Resource
- $type : string|null = null
-
The resource type or null if unknown
- $ignoreErrors : bool = false
-
Whether to ignore import errors or not
- $sourceResource : string|null = null
-
The original resource importing the new resource
- $exclude : string|array<string|int, string>|null = null
-
Glob patterns to exclude from the import
Tags
load()
Loads from attributes from a file.
public
load(mixed $path[, string|null $type = null ]) : mixed
Parameters
- $path : mixed
- $type : string|null = null
Tags
resolve()
Finds a loader able to load an imported resource.
public
resolve(mixed $resource[, string|null $type = null ]) : LoaderInterface
Parameters
- $resource : mixed
- $type : string|null = null
Tags
Return values
LoaderInterfacesetCurrentDir()
Sets the current directory.
public
setCurrentDir(string $dir) : void
Parameters
- $dir : string
setResolver()
Sets the loader resolver.
public
setResolver(LoaderResolverInterface $resolver) : void
Parameters
- $resolver : LoaderResolverInterface
supports()
Returns whether this class supports the given resource.
public
supports(mixed $resource[, string|null $type = null ]) : bool
Parameters
- $resource : mixed
-
A resource
- $type : string|null = null
Return values
boolfindClass()
Returns the full class name for the first class in the file.
protected
findClass(string $file) : string|false
Parameters
- $file : string