Elgg  Version 6.0
Public Member Functions | Protected Attributes | List of all members
Elgg\HandlersService Class Reference

Helpers for providing callable-based APIs. More...

Public Member Functions

 call ($callable, $object, $args)
 Call the handler with the event object. More...
 
 isCallable ($callback)
 Test is callback is callable Unlike is_callable(), this function also tests invokable classes. More...
 
 resolveCallable ($callable)
 Resolve a callable, possibly instantiating a class name. More...
 
 describeCallable ($callable, $file_root= '')
 Get a string description of a callback. More...
 

Protected Attributes

const CLASS_NAME_PATTERN_53 = '/^(\\\\?[a-z_\x7f-\xff][a-z0-9_\x7f-\xff]*)+$/i'
 

Detailed Description

Helpers for providing callable-based APIs.

Definition at line 15 of file HandlersService.php.

Member Function Documentation

Elgg\HandlersService::call (   $callable,
  $object,
  $args 
)

Call the handler with the event object.

Parameters
callable$callableCallable
mixed$objectEvent object
array$argsArguments for legacy events
Returns
array [success, result, object]

Definition at line 30 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)"

Parameters
mixed$callableCallable
string$file_rootIf provided, it will be removed from the beginning of file names
Returns
string

Definition at line 115 of file HandlersService.php.

Elgg\HandlersService::isCallable (   $callback)

Test is callback is callable Unlike is_callable(), this function also tests invokable classes.

See also
is_callable()
Parameters
mixed$callbackCallable
Returns
bool

Definition at line 80 of file HandlersService.php.

Elgg\HandlersService::resolveCallable (   $callable)

Resolve a callable, possibly instantiating a class name.

Parameters
callable | string$callableCallable or class name
Returns
callable|null

Definition at line 92 of file HandlersService.php.

Member Data Documentation

const Elgg\HandlersService::CLASS_NAME_PATTERN_53 = '/^(\\\\?[a-z_\x7f-\xff][a-z0-9_\x7f-\xff]*)+$/i'
protected

Definition at line 19 of file HandlersService.php.


The documentation for this class was generated from the following file: