PHP Класс FOF30\Pimple\Container

Автор: Fabien Potencier
Наследование: implements ArrayAccess
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( array $values = [] ) Instantiate the container.
extend ( string $id, callable $callable ) : callable Extends an object definition.
factory ( callable $callable ) : callable Marks a callable as being a factory service.
keys ( ) : array Returns all defined value names.
offsetExists ( string $id ) : boolean Checks if a parameter or an object is set.
offsetGet ( string $id ) : mixed Gets a parameter or an object.
offsetSet ( string $id, mixed $value ) Sets a parameter or an object.
offsetUnset ( string $id ) Unsets a parameter or an object.
protect ( callable $callable ) : callable Protects a callable from being interpreted as a service.
raw ( string $id ) : mixed Gets a parameter or the closure defining an object.
register ( FOF30\Pimple\ServiceProviderInterface $provider, array $values = [] ) : static Registers a service provider.

Описание методов

__construct() публичный Метод

Objects and parameters can be passed as argument to the constructor.
public __construct ( array $values = [] )
$values array The parameters or objects.

extend() публичный Метод

Useful when you want to extend an existing object definition, without necessarily loading that object.
public extend ( string $id, callable $callable ) : callable
$id string The unique identifier for the object
$callable callable A service definition to extend the original
Результат callable The wrapped callable

factory() публичный Метод

Marks a callable as being a factory service.
public factory ( callable $callable ) : callable
$callable callable A service definition to be used as a factory
Результат callable The passed callable

keys() публичный Метод

Returns all defined value names.
public keys ( ) : array
Результат array An array of value names

offsetExists() публичный Метод

Checks if a parameter or an object is set.
public offsetExists ( string $id ) : boolean
$id string The unique identifier for the parameter or object
Результат boolean

offsetGet() публичный Метод

Gets a parameter or an object.
public offsetGet ( string $id ) : mixed
$id string The unique identifier for the parameter or object
Результат mixed The value of the parameter or an object

offsetSet() публичный Метод

Objects must be defined as Closures. Allowing any PHP callable leads to difficult to debug problems as function names (strings) are callable (creating a function with the same name as an existing parameter would break your container).
public offsetSet ( string $id, mixed $value )
$id string The unique identifier for the parameter or object
$value mixed The value of the parameter or a closure to define an object

offsetUnset() публичный Метод

Unsets a parameter or an object.
public offsetUnset ( string $id )
$id string The unique identifier for the parameter or object

protect() публичный Метод

This is useful when you want to store a callable as a parameter.
public protect ( callable $callable ) : callable
$callable callable A callable to protect from being evaluated
Результат callable The passed callable

raw() публичный Метод

Gets a parameter or the closure defining an object.
public raw ( string $id ) : mixed
$id string The unique identifier for the parameter or object
Результат mixed The value of the parameter or the closure defining an object

register() публичный Метод

Registers a service provider.
public register ( FOF30\Pimple\ServiceProviderInterface $provider, array $values = [] ) : static
$provider FOF30\Pimple\ServiceProviderInterface A ServiceProviderInterface instance
$values array An array of values that customizes the provider
Результат static