Method |
Description |
|
__clone ( ) |
|
|
addParameter ( string $parameterName ) |
Add a new parameter to the method/function. |
|
export ( ) |
|
|
getAst ( ) : ClassMethod | Function_ |
Fetch the AST for this method or function. |
|
getBodyAst ( ) : PhpParser\Node[] |
Retrieves the body of this function as AST nodes |
|
getBodyCode ( PrettyPrinterAbstract $printer = null ) : string |
Retrieves the body of this function as code. |
|
getDocBlockReturnTypes ( ) : phpDocumentor\Reflection\Type[] |
Get the return types defined in the DocBlocks. This returns an array because
the parameter may have multiple (compound) types specified (for example
when you type hint pipe-separated "string|null", in which case this
would return an array of Type objects, one for string, one for null. |
|
getDocComment ( ) : string |
|
|
getEndLine ( ) : integer |
Get the line number that this function ends on. |
|
getFileName ( ) : string |
|
|
getLocatedSource ( ) : BetterReflection\SourceLocator\Located\LocatedSource |
|
|
getName ( ) : string |
Get the "full" name of the function (e.g. for A\B\foo, this will return
"A\B\foo"). |
|
getNamespaceName ( ) : string |
Get the "namespace" name of the function (e.g. for A\B\foo, this will
return "A\B"). |
|
getNumberOfParameters ( ) : integer |
Get the number of parameters for this class. |
|
getNumberOfRequiredParameters ( ) : integer |
Get the number of required parameters for this method. |
|
getParameter ( string $parameterName ) : ReflectionParameter | null |
Get a single parameter by name. Returns null if parameter not found for
the function. |
|
getParameters ( ) : ReflectionParameter[] |
Get an array list of the parameters for this method signature, as an
array of ReflectionParameter instances. |
|
getReturnStatementsAst ( ) : PhpParser\Node\Stmt\Return_[] |
Fetch an array of all return statements found within this function. |
|
getReturnType ( ) : ReflectionType | null |
Get the return type declaration (only for PHP 7+ code) |
|
getShortName ( ) : string |
Get the "short" name of the function (e.g. for A\B\foo, this will return
"foo"). |
|
getStartLine ( ) : integer |
Get the line number that this function starts on. |
|
hasReturnType ( ) : boolean |
Do we have a return type declaration (only for PHP 7+ code) |
|
inNamespace ( ) : boolean |
Decide if this function is part of a namespace. Returns false if the class
is in the global namespace or does not have a specified namespace. |
|
isClosure ( ) : boolean |
Is this function a closure? |
|
isDeprecated ( ) : boolean |
Is this function deprecated? |
|
isGenerator ( ) : boolean |
Check if this function can be used as a generator (i.e. contains the
"yield" keyword). |
|
isInternal ( ) : boolean |
Is this an internal function? |
|
isUserDefined ( ) : boolean |
Is this a user-defined function (will always return the opposite of
whatever isInternal returns). |
|
isVariadic ( ) : boolean |
Check if the function has a variadic parameter. |
|
removeParameter ( string $parameterName ) : void |
Remove a parameter from the method/function. |
|
removeReturnType ( ) |
Remove the return type declaration completely. |
|
returnsReference ( ) : boolean |
Is this function declared as a reference. |
|
setBodyFromAst ( array $nodes ) |
Override the method or function's body of statements with an entirely new
body of statements within the reflection. |
|
setBodyFromClosure ( Closure $newBody ) |
Override the method or function's body of statements with an entirely new
body of statements within the reflection. |
|
setBodyFromString ( string $newBody ) |
Override the method or function's body of statements with an entirely new
body of statements within the reflection. |
|
setReturnType ( phpDocumentor\Reflection\Type $newReturnType ) |
Set the return type declaration. |
|