PHP 클래스 Essence\Di\Container

Inspired by Pimple (https://github.com/fabpot/Pimple). Pimple wasn't used because of the way composer works. If someone were working on a project using Pimple in a different version than Essence's, the installation would fail.
파일 보기 프로젝트 열기: benjamminf/craft-embedded-assets 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_properties array Container properties.

공개 메소드들

메소드 설명
configure ( array $properties ) Merges the given properties with the current ones.
get ( string $property, mixed $default = null ) : mixed Returns the value of the given property.
set ( string $property, mixed $value ) Sets the value of the given property.
unique ( Closure $closure ) : Closure Returns a wrapper that memoizes the result of the given closure.

메소드 상세

configure() 공개 메소드

Merges the given properties with the current ones.
public configure ( array $properties )
$properties array Properties to merge.

get() 공개 메소드

Returns the value of the given property.
public get ( string $property, mixed $default = null ) : mixed
$property string Property name.
$default mixed Default value to be returned in case the property doesn't exists.
리턴 mixed The property value, or the result of the closure execution if property is a closure, or $default.

set() 공개 메소드

Sets the value of the given property.
public set ( string $property, mixed $value )
$property string Property name.
$value mixed New value.

unique() 공개 정적인 메소드

Returns a wrapper that memoizes the result of the given closure.
public static unique ( Closure $closure ) : Closure
$closure Closure Closure to wrap.
리턴 Closure Wrapper.

프로퍼티 상세

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

Container properties.
protected array $_properties
리턴 array