Trait CallableResolverAwareTrait
Resolve Callable
This trait enables the resolution of 'class:method' strings into a closure. This class is based on \Slim\CallableResolverAwareTrait Slim's trait.
The resolver will attempt checks on the current class, an optional alternate object, the DI container.
Can resolve the following string formats:
- 'class:method'
- 'parent:method'
- 'static:method'
- 'self:method' or ':method'
protected
|
#
setCallableResolver( Slim\Interfaces\CallableResolverInterface $resolver )
Set a callable resolver. |
protected
Closure
|
#
resolveCallable( callable|string $callable, object|null $context = null )
Resolve a string of the format 'class:method' into a closure that the router can dispatch. |
protected static
array
|
$resolvedCallableCache
The cache of string-based callables. |
#
[]
|
protected
string
|
$callablePattern
A regular expression for matching 'class:method' callable strings. |
#
'!^([^\:]+)?\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!'
|
protected
Slim\Interfaces\CallableResolverInterface
|
$callableResolver
Store the callable resolver. |