Stdlib/CallbackHandler.php

Show: inherited
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 [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

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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotectedstring|array $callback =

<p>PHP callback to invoke</p>
Details
Type
string | array
Propertyprotectedbool $error = false

Did an error occur when testing the validity of the callback?

Default valuefalseDetails
Type
bool
Propertyprotectedarray $metadata =

Callback metadata, if any

Details
Type
array

Methods

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

Constructor

Parameters
Name Type Description
$callback string | array | object

PHP callback

$metadata
methodpublic__invoke() : mixed

Invoke as functor

Returns
Type Description
mixed
methodpubliccall(array $args = array()) : mixed

Invoke handler

Parameters
Name Type Description
$args array

Arguments to pass to callback

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

Error handler

Used by registerCallback() when calling is_callable() to capture engine warnings.

Parameters
Name Type Description
$errno int
$errstr string
methodpublicgetCallback() : \Callable

Retrieve registered callback

Returns
Type Description
\Callable
methodpublicgetMetadata() : array

Get all callback metadata

Returns
Type Description
array
methodpublicgetMetadatum(string $name) : mixed

Retrieve a single metadatum

Parameters
Name Type Description
$name string
Returns
Type Description
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
Name Type Description
$callback \Callable
methodprotectedvalidateStringCallbackFor54(string $callback) : true

Validate a static method call

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

Parameters
Name Type Description
$callback string
Returns
Type Description
true
Throws
Exception Description
\Zend_Stdlib_Exception_InvalidCallbackException if invalid
Documentation was generated by phpDocumentor 2.0.0a8.