Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcReflectionFunction

Reflection::ezcReflectionFunction

Class ezcReflectionFunction

Extends the ReflectionFunction class to provide type information using PHPDoc annotations.

Source for this file: /Reflection/src/function.php

ReflectionFunction
   |
   --ezcReflectionFunction
Version:   //autogen//

Inherited Constants

From ReflectionFunction (Internal Class):
IS_DEPRECATED = 262144

Member Variables

protected ezcReflectionDocCommentParser $docParser
protected string|ReflectionFunction $reflectionSource

Inherited Member Variables

From ReflectionFunction (Internal Class)
public $name

Method Summary

public static mixed export( $function , [ $return = false] )
Exports a ReflectionFunction object.
public ezcReflectionFunction __construct( $function )
Constructs a new ezcReflectionFunction object
protected mixed forwardCallToReflectionSource( $method , [ $arguments = array()] )
Forwards a method invocation to either the reflection source passed to the constructor of this class when creating an instance or to the parent class.
public ezcReflectionAnnotation[] getAnnotations( [ $name = ''] )
Returns an array of annotations (optinally only annotations of a given name)
public string getCode( )
Returns the source code of the function
public string getDocComment( )
Returns the doc comment for this function
public integer getEndLine( )
Returns the line this function's declaration ends at
public ezcReflectionExtension getExtension( )
Returns NULL or the extension the function belongs to
public string|boolean getExtensionName( )
Returns false or the name of the extension the function belongs to
public string getFileName( )
Returns the filename of the file this function was declared in
public string getLongDescription( )
Returns the long description from the function's documentation
public string getName( )
Returns this function's name
public string getNamespaceName( )
Returns the name of namespace where this function is defined
public integer getNumberOfParameters( )
Returns the number of parameters
public integer getNumberOfRequiredParameters( )
Returns the number of required parameters
public ezcReflectionParameter[] getParameters( )
Returns the parameters of the function as ezcReflectionParameter objects
public string getReturnDescription( )
Returns the description of the return value
public ezcReflectionType getReturnType( )
Returns the type of the return value
public string getShortDescription( )
Returns the short description from the function's documentation
public string getShortName( )
Returns the short name of the function (without namespace part)
public integer getStartLine( )
Returns the line this function's declaration starts at
public array getStaticVariables( )
Returns an associative array containing this function's static variables and their values
public boolean hasAnnotation( $annotation )
Checks whether the function is annotated with the annotation $annotation
public boolean inNamespace( )
Returns whether this function is defined in a namespace
public mixed invoke( [ $arguments = array()] , $argument,... )
Invokes the function
public mixed invokeArgs( $arguments )
Invokes the function and allows to pass its arguments as an array
public boolean isClosure( )
Returns whether this is a closure
public boolean isDeprecated( )
Returns whether this function is deprecated
public boolean isDisabled( )
Returns whether this function has been disabled or not
public boolean isInternal( )
Returns whether this is an internal function
public boolean isUserDefined( )
Returns whether this is a user-defined function
public boolean returnsReference( )
Returns whether this function returns a reference
public mixed __call( $method , $arguments )
Use overloading to call additional methods of the ReflectionFunction instance given to the constructor.
public string __toString( )
Returns a string representation

Inherited Methods

From ReflectionFunction (Internal Class)
public ReflectionFunction constructor __construct ( $name )
public void export ( $name, [$return = ] )
public void getDocComment ( )
public void getEndLine ( )
public void getExtension ( )
public void getExtensionName ( )
public void getFileName ( )
public void getName ( )
public void getNamespaceName ( )
public void getNumberOfParameters ( )
public void getNumberOfRequiredParameters ( )
public void getParameters ( )
public void getShortName ( )
public void getStartLine ( )
public void getStaticVariables ( )
public void inNamespace ( )
public void invoke ( [$args = ] )
public void invokeArgs ( $args )
public void isClosure ( )
public void isDeprecated ( )
public void isDisabled ( )
public void isInternal ( )
public void isUserDefined ( )
public void returnsReference ( )
public void __clone ( )
public void __toString ( )

Methods

export

static mixed export( string $function , [boolean $return = false] )

Exports a ReflectionFunction object.

Returns the output if TRUE is specified for $return, printing it otherwise. This is purely a wrapper method, which calls the corresponding method of the parent class (ReflectionFunction::export()).

Parameters:
Name Type Description
$function string Name of the function
$return boolean Whether to return (TRUE) or print (FALSE) the output
Redefinition of:
Method Description
ReflectionFunction::export ( $name, [$return = ] )

__construct

ezcReflectionFunction __construct( string|ReflectionFunction $function )

Constructs a new ezcReflectionFunction object

Throws an Exception in case the given function does not exist

Parameters:
Name Type Description
$function string|ReflectionFunction Name or ReflectionFunction object of the function to be reflected
Redefinition of:
Method Description
ReflectionFunction::constructor __construct ( $name )

forwardCallToReflectionSource

mixed forwardCallToReflectionSource( string $method , [mixed[] $arguments = array()] )

Forwards a method invocation to either the reflection source passed to the constructor of this class when creating an instance or to the parent class.

This method is part of the dependency injection mechanism and serves as a helper for implementing wrapper methods without code duplication.

Parameters:
Name Type Description
$method string Name of the method to be invoked
$arguments mixed[] Arguments to be passed to the method

getAnnotations

ezcReflectionAnnotation[] getAnnotations( [string $name = ''] )

Returns an array of annotations (optinally only annotations of a given name)

Parameters:
Name Type Description
$name string Name of the annotations

getCode

string getCode( )

Returns the source code of the function

getDocComment

string getDocComment( )

Returns the doc comment for this function

Redefinition of:
Method Description
ReflectionFunction::getDocComment ( )

getEndLine

integer getEndLine( )

Returns the line this function's declaration ends at

Redefinition of:
Method Description
ReflectionFunction::getEndLine ( )

getExtension

ezcReflectionExtension getExtension( )

Returns NULL or the extension the function belongs to

Redefinition of:
Method Description
ReflectionFunction::getExtension ( )

getExtensionName

string|boolean getExtensionName( )

Returns false or the name of the extension the function belongs to

Redefinition of:
Method Description
ReflectionFunction::getExtensionName ( )

getFileName

string getFileName( )

Returns the filename of the file this function was declared in

Redefinition of:
Method Description
ReflectionFunction::getFileName ( )

getLongDescription

string getLongDescription( )

Returns the long description from the function's documentation

getName

string getName( )

Returns this function's name

Redefinition of:
Method Description
ReflectionFunction::getName ( )

getNamespaceName

string getNamespaceName( )

Returns the name of namespace where this function is defined

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionFunction::getNamespaceName ( )

getNumberOfParameters

integer getNumberOfParameters( )

Returns the number of parameters

Redefinition of:
Method Description
ReflectionFunction::getNumberOfParameters ( )

getNumberOfRequiredParameters

integer getNumberOfRequiredParameters( )

Returns the number of required parameters

Redefinition of:
Method Description
ReflectionFunction::getNumberOfRequiredParameters ( )

getParameters

ezcReflectionParameter[] getParameters( )

Returns the parameters of the function as ezcReflectionParameter objects

Redefinition of:
Method Description
ReflectionFunction::getParameters ( )

getReturnDescription

string getReturnDescription( )

Returns the description of the return value

getReturnType

ezcReflectionType getReturnType( )

Returns the type of the return value

getShortDescription

string getShortDescription( )

Returns the short description from the function's documentation

getShortName

string getShortName( )

Returns the short name of the function (without namespace part)

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionFunction::getShortName ( )

getStartLine

integer getStartLine( )

Returns the line this function's declaration starts at

Redefinition of:
Method Description
ReflectionFunction::getStartLine ( )

getStaticVariables

array getStaticVariables( )

Returns an associative array containing this function's static variables and their values

Redefinition of:
Method Description
ReflectionFunction::getStaticVariables ( )

hasAnnotation

boolean hasAnnotation( string $annotation )

Checks whether the function is annotated with the annotation $annotation

Parameters:
Name Type Description
$annotation string Name of the annotation

inNamespace

boolean inNamespace( )

Returns whether this function is defined in a namespace

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionFunction::inNamespace ( )

invoke

mixed invoke( [ $arguments = array()] , mixed $argument,... )

Invokes the function

Parameters:
Name Type Description
$argument,... mixed Arguments
$arguments
Redefinition of:
Method Description
ReflectionFunction::invoke ( [$args = ] )

invokeArgs

mixed invokeArgs( $arguments )

Invokes the function and allows to pass its arguments as an array

Parameters:
Name Type Description
$arguments array Arguments
Redefinition of:
Method Description
ReflectionFunction::invokeArgs ( $args )

isClosure

boolean isClosure( )

Returns whether this is a closure

This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.

Redefinition of:
Method Description
ReflectionFunction::isClosure ( )

isDeprecated

boolean isDeprecated( )

Returns whether this function is deprecated

This is purely a wrapper method, which calls the corresponding method of the parent class.

Redefinition of:
Method Description
ReflectionFunction::isDeprecated ( )

isDisabled

boolean isDisabled( )

Returns whether this function has been disabled or not

Redefinition of:
Method Description
ReflectionFunction::isDisabled ( )

isInternal

boolean isInternal( )

Returns whether this is an internal function

Redefinition of:
Method Description
ReflectionFunction::isInternal ( )

isUserDefined

boolean isUserDefined( )

Returns whether this is a user-defined function

Redefinition of:
Method Description
ReflectionFunction::isUserDefined ( )

returnsReference

boolean returnsReference( )

Returns whether this function returns a reference

Redefinition of:
Method Description
ReflectionFunction::returnsReference ( )

__call

mixed __call( string $method , array $arguments )

Use overloading to call additional methods of the ReflectionFunction instance given to the constructor.

Parameters:
Name Type Description
$method string Method to be called
$arguments array Arguments that were passed

__toString

string __toString( )

Returns a string representation

Redefinition of:
Method Description
ReflectionFunction::__toString ( )
Documentation generated by phpDocumentor 1.4.3