PHP Class Autarky\Config\LoaderFactory

Keeps an array of extension => class, where the class is lazily resolved out of the framework's service container when needed.
Datei anzeigen Open project: autarky/framework Class Usage Examples

Protected Properties

Property Type Description
$container Autarky\Container\ClassResolverInterface The container instance.
$extensions string[] The registered extensions.
$loaderClasses string[] The loader classes.
$loaders Autarky\Config\LoaderInterface[] The loader class instances.

Public Methods

Method Description
__construct ( Autarky\Container\ClassResolverInterface $container )
addLoader ( string $extensions, string | Autarky\Config\LoaderInterface $loaderClass ) : void Add a loader.
getExtensions ( ) : array Get the available extensions.
getForPath ( string $path ) : Autarky\Config\LoaderInterface Get the loader for a given path.

Protected Methods

Method Description
getExtension ( $path )
resolveLoader ( $extension )

Method Details

__construct() public method

public __construct ( Autarky\Container\ClassResolverInterface $container )
$container Autarky\Container\ClassResolverInterface

addLoader() public method

Add a loader.
public addLoader ( string $extensions, string | Autarky\Config\LoaderInterface $loaderClass ) : void
$extensions string
$loaderClass string | Autarky\Config\LoaderInterface
return void

getExtension() protected method

protected getExtension ( $path )

getExtensions() public method

Get the available extensions.
public getExtensions ( ) : array
return array

getForPath() public method

Get the loader for a given path.
public getForPath ( string $path ) : Autarky\Config\LoaderInterface
$path string
return Autarky\Config\LoaderInterface

resolveLoader() protected method

protected resolveLoader ( $extension )

Property Details

$container protected_oe property

The container instance.
protected ClassResolverInterface,Autarky\Container $container
return Autarky\Container\ClassResolverInterface

$extensions protected_oe property

The registered extensions.
protected string[] $extensions
return string[]

$loaderClasses protected_oe property

The loader classes.
protected string[] $loaderClasses
return string[]

$loaders protected_oe property

The loader class instances.
protected LoaderInterface[],Autarky\Config $loaders
return Autarky\Config\LoaderInterface[]