LoaderResolver
in package
implements
LoaderResolverInterface
LoaderResolver selects a loader for a given resource.
A resource can be anything (e.g. a full path to a config file or a Closure). Each loader determines whether it can load a resource and how.
Tags
Table of Contents
Interfaces
- LoaderResolverInterface
- LoaderResolverInterface selects a loader for a given resource.
Properties
- $loaders : array<string|int, LoaderInterface>
Methods
- __construct() : mixed
- addLoader() : mixed
- getLoaders() : array<string|int, LoaderInterface>
- Returns the registered loaders.
- resolve() : LoaderInterface|false
- Returns a loader able to load the resource.
Properties
$loaders
private
array<string|int, LoaderInterface>
$loaders
= []
An array of LoaderInterface objects
Methods
__construct()
public
__construct([array<string|int, LoaderInterface> $loaders = [] ]) : mixed
Parameters
- $loaders : array<string|int, LoaderInterface> = []
-
An array of loaders
addLoader()
public
addLoader(LoaderInterface $loader) : mixed
Parameters
- $loader : LoaderInterface
getLoaders()
Returns the registered loaders.
public
getLoaders() : array<string|int, LoaderInterface>
Return values
array<string|int, LoaderInterface>resolve()
Returns a loader able to load the resource.
public
resolve(mixed $resource[, string $type = null ]) : LoaderInterface|false
Parameters
- $resource : mixed
- $type : string = null
-
The resource type or null if unknown