CallbackHandler

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

category Zend
package Zend_Stdlib

 Methods

Constructor

__construct(string | array | object | \Zend\Stdlib\callable $callback, array $metadata) 

Parameters

$callback

stringarrayobject\Zend\Stdlib\callable

PHP callback

$metadata

array

Callback metadata

Invoke as functor

__invoke() : mixed

Returns

mixed

Invoke handler

call(array $args) : mixed

Parameters

$args

array

Arguments to pass to callback

Returns

mixed

Retrieve registered callback

getCallback() : \Zend\Stdlib\callable

Returns

\Zend\Stdlib\callable

Retrieve a single metadatum

getMetadatum(string $name) : mixed

Parameters

$name

string

Returns

mixed

Registers the callback provided in the constructor

registerCallback(\Zend\Stdlib\callable $callback) : void

If you have pecl/weakref {@see http://pecl.php.net/weakref} installed, this method provides additional behavior.

If a callback is a functor, or an array callback composing an object instance, this method will pass the object to a WeakRef instance prior to registering the callback.

Parameters

$callback

\Zend\Stdlib\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

 

<p>PHP callback to invoke</p>

$callback : string | array | \Zend\Stdlib\callable

 

Is pecl/weakref extension installed?

$hasWeakRefExtension : bool

 

PHP version is greater as 5.4rc1?

$isPhp54 : bool