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 |
|---|
callableThe callable method to execute
arrayThe 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 |
|---|
stringThe name of the service
\Klein\Exceptions\UnknownServiceException |
If a non-registered service is attempted to fetched |
|---|
mixedregister(string $name, callable $closure) : mixed
| access | public |
|---|
stringThe name of the service
callableThe 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 |
|---|