Elgg
Version 3.0
|
Helpers for providing callable-based APIs. More...
Public Member Functions | |
call ($callable, $object, $args) | |
Call the handler with the hook/event object. More... | |
isCallable ($callback) | |
Test is callback is callable Unlike is_callable(), this function also tests invokable classes. More... | |
getReflector ($callable) | |
Get the reflection interface for a callable. More... | |
getParamTypeForCallable ($callable, $index=0) | |
Get the type for a parameter of a callable. More... | |
getType (\ReflectionParameter $param) | |
Get the type of a parameter. More... | |
describeCallable ($callable, $file_root= '') | |
Get a string description of a callback. More... | |
fingerprintCallable ($callable) | |
Get a string that uniquely identifies a callback across requests (for caching) More... | |
Helpers for providing callable-based APIs.
getType() uses code from Zend::detectType. https://github.com/zendframework/zend-code/blob/master/src/Reflection/ParameterReflection.php
Definition at line 20 of file HandlersService.php.
Elgg\HandlersService::call | ( | $callable, | |
$object, | |||
$args | |||
) |
Call the handler with the hook/event object.
callable | $callable | Callable |
mixed | $object | Event object |
array | $args | Arguments for legacy events/hooks |
Definition at line 31 of file HandlersService.php.
Elgg\HandlersService::describeCallable | ( | $callable, | |
$file_root = '' |
|||
) |
Get a string description of a callback.
E.g. "function_name", "Static::method", "(ClassName)->method", "(Closure path/to/file.php:23)"
mixed | $callable | Callable |
string | $file_root | If provided, it will be removed from the beginning of file names |
Definition at line 219 of file HandlersService.php.
Elgg\HandlersService::fingerprintCallable | ( | $callable | ) |
Get a string that uniquely identifies a callback across requests (for caching)
callable | $callable | Callable |
Definition at line 253 of file HandlersService.php.
Elgg\HandlersService::getParamTypeForCallable | ( | $callable, | |
$index = 0 |
|||
) |
Get the type for a parameter of a callable.
callable | $callable | Callable |
int | $index | Index of argument |
Definition at line 164 of file HandlersService.php.
Elgg\HandlersService::getReflector | ( | $callable | ) |
Get the reflection interface for a callable.
callable | $callable | Callable |
Definition at line 94 of file HandlersService.php.
Elgg\HandlersService::getType | ( | \ReflectionParameter | $param | ) |
Get the type of a parameter.
\ReflectionParameter | $param | Parameter |
Definition at line 180 of file HandlersService.php.
Elgg\HandlersService::isCallable | ( | $callback | ) |
Test is callback is callable Unlike is_callable(), this function also tests invokable classes.
mixed | $callback | Callable |
Definition at line 82 of file HandlersService.php.