Stdlib/CallbackHandler.php

Show: PublicProtectedPrivateinherited
Table of Contents
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
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

>VPropertyprotectedstring|array $callback

PHP callback to invoke

Details
Type
string | array
>VPropertyprotectedbool $error = false
Did an error occur when testing the validity of the callback?
Default valuefalseDetails
Type
bool
>VPropertyprotectedarray $metadata
Callback metadata, if any
Details
Type
array

Methods

methodpublic__construct(string | array | object $callback,  $metadata = array()) : void

Constructor

Parameters
NameTypeDescription
$callbackstring | array | object

PHP callback

$metadata
methodpublic__invoke() : mixed

Invoke as functor

Returns
TypeDescription
mixed
methodpubliccall(array $args = array()) : mixed

Invoke handler

Parameters
NameTypeDescription
$argsarray

Arguments to pass to callback

Returns
TypeDescription
mixed
methodpublicerrorHandler(int $errno, string $errstr) : void

Error handler

Used by registerCallback() when calling is_callable() to capture engine warnings.
Parameters
NameTypeDescription
$errnoint
$errstrstring
methodpublicgetCallback() : Callable

Retrieve registered callback

Returns
TypeDescription
Callable
methodpublicgetMetadata() : array

Get all callback metadata

Returns
TypeDescription
array
methodpublicgetMetadatum(string $name) : mixed

Retrieve a single metadatum

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
mixed
methodprotectedregisterCallback(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.
Parameters
NameTypeDescription
$callbackCallable
methodprotectedvalidateStringCallbackFor54(string $callback) : true

Validate a static method call

Validates that a static method call in PHP 5.4 will actually work
Parameters
NameTypeDescription
$callbackstring
Returns
TypeDescription
true
Throws
ExceptionDescription
\Zend_Stdlib_Exception_InvalidCallbackExceptionif invalid
Documentation was generated by phpDocumentor 2.2.0 .