PHP Class Cascade\Config\Loader\ClassLoader\Resolver\ExtraOptionsResolver

Author: Raphael Antonmattei ([email protected])
Datei anzeigen Open project: theorchard/monolog-cascade Class Usage Examples

Protected Properties

Property Type Description
$params array Associative array of parameters to resolve against
$reflected ReflectionClass Reflection class for which you want to resolve extra options

Public Methods

Method Description
__construct ( ReflectionClass $reflected, array $params = [] ) Constructor
generateParamsHashKey ( $params ) : string Generate a unique hash based on the keys of the extra params
getParams ( ) : array Get the parameters we want to resolve against
getReflected ( ) : ReflectionClass Returns the reflected object
resolve ( array $options, ClassLoader $classLoader = null ) : array Resolve options against extra params requirements
setParams ( array $params = [] ) Set the parameters we want to resolve against

Protected Methods

Method Description
configureOptions ( Symfony\Component\OptionsResolver\OptionsResolver $resolver, ClassLoader $classLoader = null ) Configure options for the provided OptionResolver to match extra params requirements

Method Details

__construct() public method

Constructor
public __construct ( ReflectionClass $reflected, array $params = [] )
$reflected ReflectionClass Reflection class for which you want to resolve extra options
$params array Associative array of extra parameters we want to resolve against

configureOptions() protected method

Configure options for the provided OptionResolver to match extra params requirements
protected configureOptions ( Symfony\Component\OptionsResolver\OptionsResolver $resolver, ClassLoader $classLoader = null )
$resolver Symfony\Component\OptionsResolver\OptionsResolver
$classLoader Cascade\Config\Loader\ClassLoader Optional class loader if you want to use custom handlers for some of the extra options

generateParamsHashKey() public static method

Generate a unique hash based on the keys of the extra params
public static generateParamsHashKey ( $params ) : string
return string Unique MD5 hash

getParams() public method

Get the parameters we want to resolve against
public getParams ( ) : array
return array $params Associative array of parameters

getReflected() public method

Returns the reflected object
public getReflected ( ) : ReflectionClass
return ReflectionClass

resolve() public method

Resolve options against extra params requirements
public resolve ( array $options, ClassLoader $classLoader = null ) : array
$options array Array of option values
$classLoader Cascade\Config\Loader\ClassLoader Optional class loader if you want to use custom handlers to resolve the extra options
return array Array of resolved options

setParams() public method

Set the parameters we want to resolve against
public setParams ( array $params = [] )
$params array Associative array of extra parameters we want to resolve against

Property Details

$params protected_oe property

Associative array of parameters to resolve against
protected array $params
return array

$reflected protected_oe property

Reflection class for which you want to resolve extra options
protected ReflectionClass $reflected
return ReflectionClass