class NikicPropertyNode implements PropertyNode (View source)

Adapter for nikic/php-parser PropertyProperty nodes.

Implements complete PropertyNode interface. Requires both PropertyProperty (for name) and Property statement (for modifiers/type).

Methods

__construct(PropertyProperty $property, Property $propertyStmt)

No description

string
getName()

Get the property name.

bool
isPublic()

Check if the property is public.

bool
isProtected()

Check if the property is protected.

bool
isPrivate()

Check if the property is private.

bool
isStatic()

Check if the property is static.

bool
isReadonly()

Check if the property is readonly (PHP 8.1+).

TypeNode|null
getType()

Get the property type, or null if no type hint.

getDocComment()

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

array
getAttributes()

Get the property attributes (PHP 8.0+).

Details

__construct(PropertyProperty $property, Property $propertyStmt)

No description

Parameters

PropertyProperty $property
Property $propertyStmt

string getName()

Get the property name.

Return Value

string

bool isPublic()

Check if the property is public.

Return Value

bool

bool isProtected()

Check if the property is protected.

Return Value

bool

bool isPrivate()

Check if the property is private.

Return Value

bool

bool isStatic()

Check if the property is static.

Return Value

bool

bool isReadonly()

Check if the property is readonly (PHP 8.1+).

Return Value

bool

TypeNode|null getType()

Get the property type, or null if no type hint.

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 property attributes (PHP 8.0+).

Return Value

array