mini\Mini::addService()
public
Documentation
Register a service with the container
Can only be called in Bootstrap phase (before mini\bootstrap()). The container is locked once request handling begins.
Signature
public function addService(string $id, mini\Lifetime $lifetime, Closure $factory): void
Parameters
| Name | Type | Default |
|---|---|---|
$id
|
string |
required |
$lifetime
|
mini\Lifetime |
required |
$factory
|
Closure |
required |
Returns
void