PHP Interface Kraken\Container\ServiceRegisterInterface

Afficher le fichier Open project: kraken-php/framework

Méthodes publiques

Méthode Description
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.

Method Details

boot() public méthode

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() public méthode

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() public méthode

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() public méthode

Return target of given alias. If the alias is not found null will be returned.
public getAlias ( string $alias ) : null | string
$alias string
Résultat null | string

getAliases() public méthode

Return list of all aliases and its targets in form of associative array.
public getAliases ( ) : string[]
Résultat string[]

getProvider() public méthode

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
Résultat Kraken\Container\ServiceProviderInterface | null

getProviders() public méthode

Gets list with classNames of all registered ServiceProvider.
public getProviders ( ) : string[]
Résultat string[]

getServices() public méthode

Gets list with classNames of all provided services.
public getServices ( ) : string[]
Résultat string[]

registerAlias() public méthode

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() public méthode

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() public méthode

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

unregisterProvider() public méthode

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