App
package | Klein |
---|
__call(callable $method, array $args) : void
Allows the ability to arbitrarily call a property as a callable method Allow callbacks to be assigned as properties and called like normal methods
access | public |
---|
callable
The callable method to execute
array
The argument array to pass to our callback
\BadMethodCallException |
If a non-registered method is attempted to be called |
---|
__get(string $name) : mixed
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
access | public |
---|
string
The name of the service
\Klein\Exceptions\UnknownServiceException |
If a non-registered service is attempted to fetched |
---|
mixed
register(string $name, callable $closure) : mixed
access | public |
---|
string
The name of the service
callable
The callable function to execute when requesting our service
\Klein\Exceptions\DuplicateServiceException |
If an attempt is made to register two services with the same name |
---|
mixed
$services : array
access | protected |
---|