Extends the ReflectionFunction class to provide type information using PHPDoc annotations.
Source for this file: /Reflection/src/function.php
ReflectionFunction | --ezcReflectionFunction
Version: | //autogen// |
From ReflectionFunction (Internal Class): | |
---|---|
IS_DEPRECATED = 262144
|
protected ezcReflectionDocCommentParser |
$docParser
|
protected string|ReflectionFunction |
$reflectionSource
|
From ReflectionFunction (Internal Class) | |
---|---|
public |
$name
|
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 |
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 ( )
|
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()).
Name | Type | Description |
---|---|---|
$function |
string | Name of the function |
$return |
boolean | Whether to return (TRUE) or print (FALSE) the output |
Method | Description |
---|---|
ReflectionFunction::export ( $name, [$return = ] ) |
Constructs a new ezcReflectionFunction object
Throws an Exception in case the given function does not exist
Name | Type | Description |
---|---|---|
$function |
string|ReflectionFunction | Name or ReflectionFunction object of the function to be reflected |
Method | Description |
---|---|
ReflectionFunction::constructor __construct ( $name ) |
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.
Name | Type | Description |
---|---|---|
$method |
string | Name of the method to be invoked |
$arguments |
mixed[] | Arguments to be passed to the method |
Returns an array of annotations (optinally only annotations of a given name)
Name | Type | Description |
---|---|---|
$name |
string | Name of the annotations |
Returns the source code of the function
Returns the doc comment for this function
Method | Description |
---|---|
ReflectionFunction::getDocComment ( ) |
Returns the line this function's declaration ends at
Method | Description |
---|---|
ReflectionFunction::getEndLine ( ) |
Returns NULL or the extension the function belongs to
Method | Description |
---|---|
ReflectionFunction::getExtension ( ) |
Returns false or the name of the extension the function belongs to
Method | Description |
---|---|
ReflectionFunction::getExtensionName ( ) |
Returns the filename of the file this function was declared in
Method | Description |
---|---|
ReflectionFunction::getFileName ( ) |
Returns the long description from the function's documentation
Returns this function's name
Method | Description |
---|---|
ReflectionFunction::getName ( ) |
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.
Method | Description |
---|---|
ReflectionFunction::getNamespaceName ( ) |
Returns the number of parameters
Method | Description |
---|---|
ReflectionFunction::getNumberOfParameters ( ) |
Returns the number of required parameters
Method | Description |
---|---|
ReflectionFunction::getNumberOfRequiredParameters ( ) |
Returns the parameters of the function as ezcReflectionParameter objects
Method | Description |
---|---|
ReflectionFunction::getParameters ( ) |
Returns the description of the return value
Returns the type of the return value
Returns the short description from the function's documentation
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.
Method | Description |
---|---|
ReflectionFunction::getShortName ( ) |
Returns the line this function's declaration starts at
Method | Description |
---|---|
ReflectionFunction::getStartLine ( ) |
Returns an associative array containing this function's static variables and their values
Method | Description |
---|---|
ReflectionFunction::getStaticVariables ( ) |
Checks whether the function is annotated with the annotation $annotation
Name | Type | Description |
---|---|---|
$annotation |
string | Name of the annotation |
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.
Method | Description |
---|---|
ReflectionFunction::inNamespace ( ) |
Invokes the function
Name | Type | Description |
---|---|---|
$argument,... |
mixed | Arguments |
$arguments |
Method | Description |
---|---|
ReflectionFunction::invoke ( [$args = ] ) |
Invokes the function and allows to pass its arguments as an array
Name | Type | Description |
---|---|---|
$arguments |
array |
Arguments |
Method | Description |
---|---|
ReflectionFunction::invokeArgs ( $args ) |
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.
Method | Description |
---|---|
ReflectionFunction::isClosure ( ) |
Returns whether this function is deprecated
This is purely a wrapper method, which calls the corresponding method of the parent class.
Method | Description |
---|---|
ReflectionFunction::isDeprecated ( ) |
Returns whether this function has been disabled or not
Method | Description |
---|---|
ReflectionFunction::isDisabled ( ) |
Returns whether this is an internal function
Method | Description |
---|---|
ReflectionFunction::isInternal ( ) |
Returns whether this is a user-defined function
Method | Description |
---|---|
ReflectionFunction::isUserDefined ( ) |
Returns whether this function returns a reference
Method | Description |
---|---|
ReflectionFunction::returnsReference ( ) |
Use overloading to call additional methods of the ReflectionFunction instance given to the constructor.
Name | Type | Description |
---|---|---|
$method |
string | Method to be called |
$arguments |
array | Arguments that were passed |
Returns a string representation
Method | Description |
---|---|
ReflectionFunction::__toString ( ) |