\Zend_Server_Reflection_Function

Function Reflection

Decorates a ReflectionFunction. Allows setting and retrieving an alternate 'service' name (i.e., the name to be used when calling via a service), setting and retrieving the description (originally set using the docblock contents), retrieving the callback and callback type, retrieving additional method invocation arguments, and retrieving the method prototypes.

Summary

Methods
Properties
Constants
__construct()
__call()
__get()
__set()
setNamespace()
getNamespace()
setDescription()
getDescription()
getPrototypes()
getInvokeArguments()
__wakeup()
No public properties found
No constants found
_addTree()
_buildTree()
_buildSignatures()
_reflect()
$_reflection
$_argv
$_config
$_class
$_description
$_namespace
$_prototypes
N/A
No private methods found
$_return
$_returnDesc
$_paramDesc
$_sigParams
$_sigParamsDepth
N/A

Properties

$_reflection

$_reflection : \ReflectionFunction

Type

\ReflectionFunction

$_argv

$_argv : array

Additional arguments to pass to method on invocation

Type

array

$_config

$_config : array

Used to store extra configuration for the method (typically done by the server class, e.g., to indicate whether or not to instantiate a class).

Associative array; access is as properties via __get() and __set()

Type

array

$_class

$_class : string

Declaring class (needed for when serialization occurs)

Type

string

$_description

$_description : string

Function/method description

Type

string

$_namespace

$_namespace : string

Namespace with which to prefix function/method name

Type

string

$_prototypes

$_prototypes : array

Prototypes

Type

array

$_return

$_return : 

Type

$_returnDesc

$_returnDesc : 

Type

$_paramDesc

$_paramDesc : 

Type

$_sigParams

$_sigParams : 

Type

$_sigParamsDepth

$_sigParamsDepth : 

Type

Methods

__construct()

__construct(\ReflectionFunction  $r,   $namespace = null,   $argv = array()) 

Constructor

Parameters

\ReflectionFunction $r
$namespace
$argv

__call()

__call(string  $method, array  $args) : mixed

Proxy reflection calls

Parameters

string $method
array $args

Returns

mixed

__get()

__get(string  $key) : mixed

Retrieve configuration parameters

Values are retrieved by key from \$_config. Returns null if no value found.

Parameters

string $key

Returns

mixed

__set()

__set(string  $key, mixed  $value) : void

Set configuration parameters

Values are stored by $key in \$_config.

Parameters

string $key
mixed $value

setNamespace()

setNamespace(string  $namespace) : void

Set method's namespace

Parameters

string $namespace

getNamespace()

getNamespace() : string

Return method's namespace

Returns

string

setDescription()

setDescription(string  $string) : void

Set the description

Parameters

string $string

getDescription()

getDescription() : void

Retrieve the description

getPrototypes()

getPrototypes() : array

Retrieve all prototypes as array of {@link Zend_Server_Reflection_Prototype Zend_Server_Reflection_Prototypes}

Returns

array

getInvokeArguments()

getInvokeArguments() : array

Retrieve additional invocation arguments

Returns

array

__wakeup()

__wakeup() : void

Wakeup from serialization

Reflection needs explicit instantiation to work correctly. Re-instantiate reflection object on wakeup.

_addTree()

_addTree(\Zend_Server_Reflection_Node  $parent, integer  $level) : void

Create signature node tree

Recursive method to build the signature node tree. Increments through each array in \$_sigParams, adding every value of the next level to the current value (unless the current value is null).

Parameters

\Zend_Server_Reflection_Node $parent
integer $level

_buildTree()

_buildTree() : array

Build the signature tree

Builds a signature tree starting at the return values and descending through each method argument. Returns an array of Zend_Server_Reflection_Nodes.

Returns

array

_buildSignatures()

_buildSignatures(array  $return, string  $returnDesc,   $paramTypes, array  $paramDesc) : array

Build method signatures

Builds method signatures using the array of return types and the array of parameters types

Parameters

array $return

Array of return types

string $returnDesc

Return value description

$paramTypes
array $paramDesc

Array of parameter descriptions

Returns

array

_reflect()

_reflect() : array

Use code reflection to create method signatures

Determines the method help/description text from the function DocBlock comment. Determines method signatures using a combination of ReflectionFunction and parsing of DocBlock @param and @return values.

Returns

array