$services
$services :
The array of app services
App
__get(string $name) : mixed
Magic "__get" method
Allows the ability to arbitrarily request a service from this instance while treating it as an instance property
This checks the lazy service register and automatically calls the registered service method
string | $name | The name of the service |
If a non-registered service is attempted to fetched
__call(callable $method, array $args) : void
Magic "__call" method
Allows the ability to arbitrarily call a property as a callable method Allow callbacks to be assigned as properties and called like normal methods
callable | $method | The callable method to execute |
array | $args | The argument array to pass to our callback |
If a non-registered method is attempted to be called
register(string $name, callable $closure) : mixed
Register a lazy service
string | $name | The name of the service |
callable | $closure | The callable function to execute when requesting our service |
If an attempt is made to register two services with the same name