CallbackHandler

A handler for an event, event, filterchain, etc. Abstracts PHP callbacks, primarily to allow for lazy-loading and ensuring availability of default arguments (currying).

package Default

 Methods

Constructor

__construct(string|array|object|callable $callback, array $metadata = array()

Parameters

$callback

stringarrayobjectcallable

PHP callback

$metadata

array

Callback metadata

Invoke as functor

__invoke() : mixed

Returns

mixed

Invoke handler

call(array $args = array()) : mixed

Parameters

$args

array

Arguments to pass to callback

Returns

mixed

Retrieve registered callback

getCallback() : callable

Returns

callable

Retrieve a single metadatum

getMetadatum(string $name) : mixed

Parameters

$name

string

Returns

mixed

Registers the callback provided in the constructor

registerCallback(callable $callback) : void

Parameters

$callback

callable

Exceptions

\Zend\Stdlib\Exception\InvalidCallbackException

Validate a static method call

validateStringCallbackFor54(string $callback) : true | array

Validates that a static method call in PHP 5.4 will actually work

Parameters

$callback

string

Exceptions

\Zend\Stdlib\Exception\InvalidCallbackException if invalid

Returns

truearray

 Properties

 

PHP callback to invoke

$callback : string | array | callable

Default

 

PHP version is greater as 5.4rc1?

$isPhp54 : boolean

Default

Static