\app\framework\Component\Route\KleinApp

App

Summary

Methods
Properties
Constants
__get()
__call()
register()
No public properties found
No constants found
No protected methods found
$services
N/A
No private methods found
No private properties found
N/A

Properties

$services

$services : 

The array of app services

Type

Methods

__get()

__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

Parameters

string $name

The name of the service

Throws

\app\framework\Component\Route\Klein\Exceptions\UnknownServiceException

If a non-registered service is attempted to fetched

Returns

mixed

__call()

__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

Parameters

callable $method

The callable method to execute

array $args

The argument array to pass to our callback

Throws

\BadMethodCallException

If a non-registered method is attempted to be called

register()

register(string  $name, callable  $closure) : mixed

Register a lazy service

Parameters

string $name

The name of the service

callable $closure

The callable function to execute when requesting our service

Throws

\app\framework\Component\Route\Klein\Exceptions\DuplicateServiceException

If an attempt is made to register two services with the same name

Returns

mixed