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
Interfaces, Classes and Traits
- LoaderResolverInterface
- LoaderResolverInterface selects a loader for a given resource.
Table of Contents
- $loaders : array<string|int, LoaderInterface>
- __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
Return values
mixed —addLoader()
public
addLoader(LoaderInterface $loader) : mixed
Parameters
- $loader : LoaderInterface
Return values
mixed —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|null $type = null ]) : LoaderInterface|false
Parameters
- $resource : mixed
-
A resource
- $type : string|null = null
-
The resource type or null if unknown