MethodNode
interface MethodNode (View source)
Parser-agnostic interface for method AST nodes.
Exposes all method properties needed for complete parsing.
Methods
Get the method name.
Check if the method is public.
Check if the method is protected.
Check if the method is private.
Check if the method is static.
Check if the method is final.
Check if the method is abstract.
Get the method parameters.
Get the return type, or null if no return type.
Get the doc comment, or null if no doc comment.
Get the method attributes (PHP 8.0+).
Details
string
getName()
Get the method name.
bool
isPublic()
Check if the method is public.
bool
isProtected()
Check if the method is protected.
bool
isPrivate()
Check if the method is private.
bool
isStatic()
Check if the method is static.
bool
isFinal()
Check if the method is final.
bool
isAbstract()
Check if the method is abstract.
array
getParameters()
Get the method parameters.
TypeNode|null
getReturnType()
Get the return type, or null if no return type.
DocCommentNode|null
getDocComment()
Get the doc comment, or null if no doc comment.
array
getAttributes()
Get the method attributes (PHP 8.0+).