PHP 클래스 Cascade\Config\Loader\ClassLoader\Resolver\ConstructorResolver

저자: Raphael Antonmattei ([email protected])
파일 보기 프로젝트 열기: theorchard/monolog-cascade 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$constructorArgs ReflectionParameter[] Associative array of contructor args to resolve against
$reflected ReflectionClass Reflection class for which you want to resolve constructor options

공개 메소드들

메소드 설명
__construct ( ReflectionClass $reflected ) Contructor
getConstructorArgs ( ) : array Returns the contructor args as an associative array
getReflected ( ) : ReflectionClass Returns the reflected object
hashToArgsArray ( array $hashOfOptions ) : array Loops through constructor args and buid an ordered array of args using the option values passed in. We assume the passed in array has been resolved already.
initConstructorArgs ( ) Fetches constructor args (array of ReflectionParameter) from the reflected class and set them as an associative array
resolve ( array $options ) : array Resolve options against constructor args

보호된 메소드들

메소드 설명
configureOptions ( Symfony\Component\OptionsResolver\OptionsResolver $optionsResolver ) Configure options for the provided OptionResolver to match contructor args requirements

메소드 상세

__construct() 공개 메소드

Contructor
public __construct ( ReflectionClass $reflected )
$reflected ReflectionClass Reflection class for which you want to resolve constructor options

configureOptions() 보호된 메소드

Configure options for the provided OptionResolver to match contructor args requirements
protected configureOptions ( Symfony\Component\OptionsResolver\OptionsResolver $optionsResolver )
$optionsResolver Symfony\Component\OptionsResolver\OptionsResolver OptionResolver to configure

getConstructorArgs() 공개 메소드

Returns the contructor args as an associative array
public getConstructorArgs ( ) : array
리턴 array Contructor args

getReflected() 공개 메소드

Returns the reflected object
public getReflected ( ) : ReflectionClass
리턴 ReflectionClass

hashToArgsArray() 공개 메소드

i.e. That the arg name has an entry in the option array.
public hashToArgsArray ( array $hashOfOptions ) : array
$hashOfOptions array Array of options
리턴 array Array of ordered args

initConstructorArgs() 공개 메소드

Convert the parameter names to camelCase for classes that have contructor params defined in snake_case for consistency with the options
public initConstructorArgs ( )

resolve() 공개 메소드

Resolve options against constructor args
public resolve ( array $options ) : array
$options array Array of option values. Expected array looks like: array( 'someParam' => 'def', 'someOtherParam' => 'sdsad' )
리턴 array Array of resolved ordered args

프로퍼티 상세

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

Associative array of contructor args to resolve against
protected ReflectionParameter[] $constructorArgs
리턴 ReflectionParameter[]

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

Reflection class for which you want to resolve constructor options
protected ReflectionClass $reflected
리턴 ReflectionClass