Property | Type | Description | |
---|---|---|---|
$class | String | Name of the class you want to load | |
$extraOptionHandlers | array | array( '\Full\Absolute\Namespace\ClassName' => array( 'myOption' => Closure ), ... ) |
Property | Type | Description | |
---|---|---|---|
$rawOptions | array | Array of options. This is a raw copy of the options passed in. | |
$reflected | ReflectionClass | Reflected object of the class passed in |
Method | Description | |
---|---|---|
__construct ( array $options ) | Constructor | |
canHandle ( string $extraOptionName ) : boolean | Indicates whether or not an option is supported by the loader | |
getExtraOptionsHandler ( string $extraOptionName ) : Closure | null | Get the corresponding handler for a given option | |
load ( ) : mixed | Instantiate the reflected object using the parsed contructor args and set extra options if any | |
loadExtraOptions ( array $extraOptions, mixed $instance ) | Set extra options if any were requested | |
optionsToCamelCase ( array $options ) : mixed[] | Return option values indexed by name using camelCased keys |
Method | Description | |
---|---|---|
loadChildClasses ( ) | Recursively loads objects into any of the rawOptions that represent a class | |
setClass ( ) | Set the class you want to load from the raw option array |
Method | Description | |
---|---|---|
resolveOptions ( ) : array | Resolve options and returns them into 2 buckets: - constructor options and - extra options Extra options are those that are not in the contructor. The constructor arguments determine what goes into which bucket |
public __construct ( array $options ) | ||
$options | array | Array of options The option array might look like: array( 'class' => 'Some\Class', 'some_contruct_param' => 'abc', 'some_param' => 'def', 'some_other_param' => 'sdsad' ) |
protected loadChildClasses ( ) |
public loadExtraOptions ( array $extraOptions, mixed $instance ) | ||
$extraOptions | array | Array of extra options (key => value) |
$instance | mixed | Instance you want to set options for |
public static optionsToCamelCase ( array $options ) : mixed[] | ||
$options | array | Array of options |
return | mixed[] | Array of options indexed by (camelCased) name |
protected setClass ( ) |
public static array $extraOptionHandlers | ||
return | array |
protected array $rawOptions | ||
return | array |