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 license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Stdlib
\Zend_Stdlib_CallbackHandler
Package: Zend_Stdlib
Returns
Throws
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-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties
bool $error = false
Did an error occur when testing the validity of the callback?
Default value
false
Details- Type
- bool
Methods
__construct(string | array | object $callback, $metadata = array()) : void
Constructor
Parameters
Name | Type | Description |
---|---|---|
$callback | string | array | object | PHP callback |
$metadata |
call(array $args = array()) : mixed
Invoke handler
Parameters
Returns
Name | Type | Description |
---|---|---|
$args | array | Arguments to pass to callback |
Type | Description |
---|---|
mixed |
errorHandler(int $errno, string $errstr) : void
Error handler
Used by registerCallback() when calling is_callable() to capture engine warnings.
ParametersName | Type | Description |
---|---|---|
$errno | int | |
$errstr | string |
getMetadatum(string $name) : mixed
Retrieve a single metadatum
Parameters
Returns
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
mixed |
registerCallback(Callable $callback) : void
Registers 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.
ParametersName | Type | Description |
---|---|---|
$callback | Callable |
validateStringCallbackFor54(string $callback) : true
Validate a static method call
Validates that a static method call in PHP 5.4 will actually work
ParametersName | Type | Description |
---|---|---|
$callback | string |
Type | Description |
---|---|
true |
Exception | Description |
---|---|
\Zend_Stdlib_Exception_InvalidCallbackException | if invalid |