interface MethodNode (View source)

Parser-agnostic interface for method AST nodes.

Exposes all method properties needed for complete parsing.

Methods

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.

getDocComment()

Get the doc comment, or null if no doc comment.

array
getAttributes()

Get the method attributes (PHP 8.0+).

Details

string getName()

Get the method name.

Return Value

string

bool isPublic()

Check if the method is public.

Return Value

bool

bool isProtected()

Check if the method is protected.

Return Value

bool

bool isPrivate()

Check if the method is private.

Return Value

bool

bool isStatic()

Check if the method is static.

Return Value

bool

bool isFinal()

Check if the method is final.

Return Value

bool

bool isAbstract()

Check if the method is abstract.

Return Value

bool

array getParameters()

Get the method parameters.

Return Value

array

TypeNode|null getReturnType()

Get the return type, or null if no return type.

Return Value

TypeNode|null

DocCommentNode|null getDocComment()

Get the doc comment, or null if no doc comment.

Return Value

DocCommentNode|null

array getAttributes()

Get the method attributes (PHP 8.0+).

Return Value

array