|
ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
This class resolves a string of the format 'class:method' into a closure that can be dispatched. More...
Inheritance diagram for Slim\CallableResolver:
Collaboration diagram for Slim\CallableResolver:Public Member Functions | |
| __construct (ContainerInterface $container) | |
| resolve ($toResolve) | |
| Resolve toResolve into a closure so that the router can dispatch. More... | |
| resolve ($toResolve) | |
| Invoke the resolved callable. More... | |
Data Fields | |
| const | CALLABLE_PATTERN = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!' |
Protected Member Functions | |
| resolveCallable ($class, $method='__invoke') | |
| Check if string is something in the DIC that's callable or is a class name which has an __invoke() method. More... | |
| assertCallable ($callable) | |
Private Attributes | |
| $container | |
This class resolves a string of the format 'class:method' into a closure that can be dispatched.
Definition at line 19 of file CallableResolver.php.
| Slim\CallableResolver::__construct | ( | ContainerInterface | $container | ) |
| ContainerInterface | $container |
Definition at line 31 of file CallableResolver.php.
References $container.
|
protected |
| Callable | $callable |
RuntimeException if the callable is not resolvable
Definition at line 101 of file CallableResolver.php.
References sprintf.
| Slim\CallableResolver::resolve | ( | $toResolve | ) |
Resolve toResolve into a closure so that the router can dispatch.
If toResolve is of the format 'class:method', then try to extract 'class' from the container otherwise instantiate it and then dispatch 'method'.
| mixed | $toResolve |
| RuntimeException | if the callable does not exist |
| RuntimeException | if the callable is not resolvable |
Implements Slim\Interfaces\CallableResolverInterface.
Definition at line 49 of file CallableResolver.php.
|
protected |
Check if string is something in the DIC that's callable or is a class name which has an __invoke() method.
| string | $class | |
| string | $method |
RuntimeException if the callable does not exist
Definition at line 83 of file CallableResolver.php.
References sprintf.
|
private |
Definition at line 26 of file CallableResolver.php.
| const Slim\CallableResolver::CALLABLE_PATTERN = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!' |
Definition at line 21 of file CallableResolver.php.