Docs

DIContainer Interface


Definition

Namespace: DafCore
Phar: DafCore.phar

Methods

function AddSingleton(string $serviceName, Closure $callback = null) : void
Register service the current DI Container.
callback return value will be used as the service.
function BindInterface(string $interface, string $concrete) : void
Bind interface to same concrete service that Register in DI Container.
function Exists(string $serviceName) : bool
Return true if service is in the DI Container by key.
function GetOne(string $serviceName) : mixed
Get service by key in the DI Container.
function GetAll(array $keys) : array
Get All service by keys in the DI Container.