ClassNode
interface ClassNode (View source)
Parser-agnostic interface for class AST nodes.
Implementations wrap specific parser library nodes (e.g., nikic/php-parser).
Methods
Get the class name.
Check if the class is final.
Check if the class is readonly.
Get the parent class name, or null if no parent.
Get the names of implemented interfaces.
Get the class methods.
Get the class properties.
Get the class constants.
Set the namespace for this class.
Get the namespace for this class.
Get the DocComment for this class.
Get the attributes for this class.
Details
string
getName()
Get the class name.
bool
isFinal()
Check if the class is final.
bool
isReadonly()
Check if the class is readonly.
string|null
getParentClassName()
Get the parent class name, or null if no parent.
array
getInterfaceNames()
Get the names of implemented interfaces.
array
getMethods()
Get the class methods.
array
getProperties()
Get the class properties.
array
getConstants()
Get the class constants.
void
setNamespace(string $namespace)
Set the namespace for this class.
string
getNamespace()
Get the namespace for this class.
DocCommentNode|null
getDocComment()
Get the DocComment for this class.
array
getAttributes()
Get the attributes for this class.