PHP Interface Inpsyde\MultilingualPress\Service\Container

Since: 3.0.0
Inheritance: extends ArrayAcces\ArrayAccess
Show file Open project: inpsyde/multilingual-press Interface Usage Examples

Public Methods

Method Description
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.
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.

Method Details

bootstrap() public method

Bootstraps (and locks) the container.
Since: 3.0.0
public bootstrap ( ) : void
return void

extend() public method

Replaces the factory callback with the given name with the given factory callback.
Since: 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.
return static Container instance.

lock() public method

Locks the container.
Since: 3.0.0
public lock ( ) : void
return void

share() public method

Stores the given value or factory callback with the given name, and defines it to be accessible even after the container has been bootstrapped.
Since: 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.
return static Container instance.