PHP 클래스 Cascade\Config\Loader\ClassLoader

Some of them are applicable to the constructor, other are applicable to other handlers. For the latter you need to make sure there is a handler defined for that option
저자: Raphael Antonmattei ([email protected])
저자: Dom Morgan ([email protected])
파일 보기 프로젝트 열기: theorchard/monolog-cascade 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$class String Name of the class you want to load
$extraOptionHandlers array array( '\Full\Absolute\Namespace\ClassName' => array( 'myOption' => Closure ), ... )

보호된 프로퍼티들

프로퍼티 타입 설명
$rawOptions array Array of options. This is a raw copy of the options passed in.
$reflected ReflectionClass Reflected object of the class passed in

공개 메소드들

메소드 설명
__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

보호된 메소드들

메소드 설명
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

비공개 메소드들

메소드 설명
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

메소드 상세

__construct() 공개 메소드

Constructor
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' )

canHandle() 공개 메소드

Indicates whether or not an option is supported by the loader
public canHandle ( string $extraOptionName ) : boolean
$extraOptionName string Option name
리턴 boolean Whether or not an option is supported by the loader

getExtraOptionsHandler() 공개 메소드

Get the corresponding handler for a given option
public getExtraOptionsHandler ( string $extraOptionName ) : Closure | null
$extraOptionName string Option name
리턴 Closure | null Corresponding Closure object or null if not found

load() 공개 메소드

Instantiate the reflected object using the parsed contructor args and set extra options if any
public load ( ) : mixed
리턴 mixed Instance of the reflected object

loadChildClasses() 보호된 메소드

Recursively loads objects into any of the rawOptions that represent a class
protected loadChildClasses ( )

loadExtraOptions() 공개 메소드

Set extra options if any were requested
public loadExtraOptions ( array $extraOptions, mixed $instance )
$extraOptions array Array of extra options (key => value)
$instance mixed Instance you want to set options for

optionsToCamelCase() 공개 정적인 메소드

Return option values indexed by name using camelCased keys
public static optionsToCamelCase ( array $options ) : mixed[]
$options array Array of options
리턴 mixed[] Array of options indexed by (camelCased) name

setClass() 보호된 메소드

Set the class you want to load from the raw option array
protected setClass ( )

프로퍼티 상세

$class 공개적으로 프로퍼티

Name of the class you want to load
public String $class
리턴 String

$extraOptionHandlers 공개적으로 정적으로 프로퍼티

array( '\Full\Absolute\Namespace\ClassName' => array( 'myOption' => Closure ), ... )
public static array $extraOptionHandlers
리턴 array

$rawOptions 보호되어 있는 프로퍼티

Array of options. This is a raw copy of the options passed in.
protected array $rawOptions
리턴 array

$reflected 보호되어 있는 프로퍼티

Reflected object of the class passed in
protected ReflectionClass $reflected
리턴 ReflectionClass