Stdlib/CallbackHandler.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Stdlib
\Zend_Stdlib_CallbackHandler
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
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

bool $error = falseDid an error occur when testing the validity of the callback?
falseDetails- Type
- bool
Methods

__construct(string | array | object $callback, $metadata = array()) : voidConstructor
| Name | Type | Description |
|---|---|---|
| $callback | string | array | object | PHP callback |
| $metadata |

call(array $args = array()) : mixedInvoke handler
| Name | Type | Description |
|---|---|---|
| $args | array | Arguments to pass to callback |
| Type | Description |
|---|---|
| mixed |

errorHandler(int $errno, string $errstr) : voidError handler
Used by registerCallback() when calling is_callable() to capture engine warnings.
| Name | Type | Description |
|---|---|---|
| $errno | int | |
| $errstr | string |

getMetadatum(string $name) : mixedRetrieve a single metadatum
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| mixed |

registerCallback(\Callable $callback) : voidRegisters the callback provided in the constructor
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.
| Name | Type | Description |
|---|---|---|
| $callback | \Callable |

validateStringCallbackFor54(string $callback) : trueValidate a static method call
Validates that a static method call in PHP 5.4 will actually work
| Name | Type | Description |
|---|---|---|
| $callback | string |
| Type | Description |
|---|---|
| true |
| Exception | Description |
|---|---|
| \Zend_Stdlib_Exception_InvalidCallbackException | if invalid |