class LoaderResolver 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.

Methods

__construct(array $loaders = array())

No description

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

Returns a loader able to load the resource.

addLoader(LoaderInterface $loader)

No description

getLoaders()

Returns the registered loaders.

Details

at line line 32
__construct(array $loaders = array())

Parameters

array $loaders An array of loaders

at line line 42
LoaderInterface|false resolve(mixed $resource, string|null $type = null)

Returns a loader able to load the resource.

Parameters

mixed $resource A resource
string|null $type The resource type or null if unknown

Return Value

LoaderInterface|false The loader or false if none is able to load the resource

at line line 53
addLoader(LoaderInterface $loader)

Parameters

LoaderInterface $loader

at line line 64
LoaderInterface[] getLoaders()

Returns the registered loaders.

Return Value

LoaderInterface[] An array of LoaderInterface instances