PHP 클래스 Inpsyde\MultilingualPress\Service\AddOnlyContainer

부터: 3.0.0
상속: implements Inpsyde\MultilingualPress\Service\Container
파일 보기 프로젝트 열기: inpsyde/multilingual-press 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( array $values = [] ) Constructor. Sets up the properties.
bootstrap ( ) : void Bootstraps (and locks) the container.
extend ( string $name, callable $new_factory ) : static Replaces the factory callback with the given name with the given factory callback.
lock ( ) : void Locks the container.
offsetExists ( string $name ) : boolean Checks if a value or factory callback with the given name exists.
offsetGet ( string $name ) : mixed Returns the value or factory callback with the given name.
offsetSet ( string $name, mixed $value ) : void Stores the given value or factory callback with the given name.
offsetUnset ( string $name ) : void Removes the value or factory callback with the given name.
share ( string $name, mixed $value ) : static Stores the given value or factory callback with the given name, and defines it to be accessible even after the container has been bootstrapped.

메소드 상세

__construct() 공개 메소드

Constructor. Sets up the properties.
부터: 3.0.0
public __construct ( array $values = [] )
$values array Initial values or factory callbacks to be stored.

bootstrap() 공개 메소드

Only shared values and factory callbacks are accessible from now on.
부터: 3.0.0
public bootstrap ( ) : void
리턴 void

extend() 공개 메소드

The new factory callback will receive as first argument the object created by the current factory, and as second argument the container.
부터: 3.0.0
public extend ( string $name, callable $new_factory ) : static
$name string The name of an existing factory callback.
$new_factory callable The new factory callback.
리턴 static Container instance.

lock() 공개 메소드

A locked container cannot be manipulated anymore. All stored values and factory callbacks are still accessible.
부터: 3.0.0
public lock ( ) : void
리턴 void

offsetExists() 공개 메소드

Checks if a value or factory callback with the given name exists.
부터: 3.0.0
public offsetExists ( string $name ) : boolean
$name string The name of a value or factory callback.
리턴 boolean Whether or not a value or factory callback with the given name exists.

offsetGet() 공개 메소드

Returns the value or factory callback with the given name.
부터: 3.0.0
public offsetGet ( string $name ) : mixed
$name string The name of a value or factory callback.
리턴 mixed The value or factory callback with the given name.

offsetSet() 공개 메소드

Scalar values will get shared automatically.
부터: 3.0.0
public offsetSet ( string $name, mixed $value ) : void
$name string The name of a value or factory callback.
$value mixed The value or factory callback.
리턴 void

offsetUnset() 공개 메소드

Removing values or factory callbacks is not allowed.
부터: 3.0.0
public offsetUnset ( string $name ) : void
$name string The name of a value or factory callback.
리턴 void

share() 공개 메소드

Stores the given value or factory callback with the given name, and defines it to be accessible even after the container has been bootstrapped.
부터: 3.0.0
public share ( string $name, mixed $value ) : static
$name string The name of a value or factory callback.
$value mixed The value or factory callback.
리턴 static Container instance.