PHP Интерфейс Kraken\Container\ServiceRegisterInterface

Показать файл Открыть проект

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

Метод Описание
boot ( ) Boot service register.
flushAliases ( ) Flush all registered aliases.
flushProviders ( ) Flush all registered providers.
getAlias ( string $alias ) : null | string Return target of given alias. If the alias is not found null will be returned.
getAliases ( ) : string[] Return list of all aliases and its targets in form of associative array.
getProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) : Kraken\Container\ServiceProviderInterface | null Get registered ServiceProvider.
getProviders ( ) : string[] Gets list with classNames of all registered ServiceProvider.
getServices ( ) : string[] Gets list with classNames of all provided services.
registerAlias ( string $alias, string $existing ) Register service alias.
registerProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) Register ServiceProvider.
unregisterAlias ( string $alias ) Unregister previously registered service alias.
unregisterProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) Unregister previously registered ServiceProvider.

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

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

On boot the following operations will be made: 1. existing providers will be sorted to resolve its dependency trees. 2. all providers will be registered meaning ::register() method will be fired on each of them. 3. all providers will be booted meaning ::boot() method will be fired on each of them. 4. existing aliases will be registered. ExecutionException is thrown if any of this steps fails.
public boot ( )

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

This method flushes all registered aliases, if register is not booted. If the flush method is called after that the IllegalCallException will be thrown.
public flushAliases ( )

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

This method flushes all registered providers, if they were not booted. If the flush method is called after that the IllegalCallException will be thrown.
public flushProviders ( )

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

Return target of given alias. If the alias is not found null will be returned.
public getAlias ( string $alias ) : null | string
$alias string
Результат null | string

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

Return list of all aliases and its targets in form of associative array.
public getAliases ( ) : string[]
Результат string[]

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

The $provider might be concrete object implementing ServiceProviderInterface or string representing the className. In both situations ServiceRegister will look up for already registered Provider of the same class and return it. If the object is not found, null will be returned.
public getProvider ( Kraken\Container\ServiceProviderInterface | string $provider ) : Kraken\Container\ServiceProviderInterface | null
$provider Kraken\Container\ServiceProviderInterface | string
Результат Kraken\Container\ServiceProviderInterface | null

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

Gets list with classNames of all registered ServiceProvider.
public getProviders ( ) : string[]
Результат string[]

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

Gets list with classNames of all provided services.
public getServices ( ) : string[]
Результат string[]

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

ExecutionException is thrown if Container::alias() method underneath throws any errors or exceptions. ResourceOccupiedException is thrown if alias is already registered.
public registerAlias ( string $alias, string $existing )
$alias string
$existing string

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

The $provider might be concrete object implementing ServiceProviderInterface or string representing the className. In latter case, the object will be automatically created by ServiceRegister. If the provider is registered before boot its register method will be added to the queue of handlers to fire on boot. On the other hand, if register is registered after boot, its register method will be fired immediately. ExecutionException is thrown if register handler of ServiceProvider has thrown any exception or error. InvalidArgumentException is thrown if invalid Provider object or class was passed. ResourceOccupiedException is thrown if Provider of given class was already registered.
public registerProvider ( Kraken\Container\ServiceProviderInterface | string $provider )
$provider Kraken\Container\ServiceProviderInterface | string

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

ResourceUndefinedException is thrown if alias is not registered.
public unregisterAlias ( string $alias )
$alias string

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

The $provider might be concrete object implementing ServiceProviderInterface or string representing the className. In both situations ServiceRegister will look up for already registered Provider of the same class and unregister it. InvalidArgumentException is thrown if invalid Provider object or class was passed. ResourceUndefinedException is thrown if Provider of given class was not found.
public unregisterProvider ( Kraken\Container\ServiceProviderInterface | string $provider )
$provider Kraken\Container\ServiceProviderInterface | string