Guides

PropertyIterator
in package
implements Iterator

FinalYes

This class acts like a combination of a PropertyNode and PropertyProperty to be able to create property descriptors using a normal strategy.

Table of Contents

Interfaces

Iterator

Properties

$index  : int
$property  : Property

Methods

__construct()  : mixed
Instantiates this iterator with the propertyNode to iterate.
current()  : self
getDefault()  : Expr|null
returns the default value of the current property.
getDocComment()  : Doc|null
Gets the doc comment of the node.
getEndLine()  : int
Gets line the node started in.
getFqsen()  : Fqsen
Returns the fqsen of the current property.
getHooks()  : array<string|int, PropertyHook>
getLine()  : int
Gets line the node started in.
getName()  : string
returns the name of the current property.
getType()  : Identifier|Name|ComplexType|null
Gets the type of the property.
isAsymmetric()  : bool
Returns true when current property has asymetric accessors.
isPrivate()  : bool
returns true when the current property is private.
isPrivateSet()  : bool
Returns asymetric accessor value for current property.
isProtected()  : bool
returns true when the current property is protected.
isProtectedSet()  : bool
Returns asymetric accessor value for current property.
isPublic()  : bool
returns true when the current property is public.
isPublicSet()  : bool
Returns asymmetric accessor value for current property.
isReadOnly()  : bool
returns true when the current property is readonly.
isStatic()  : bool
returns true when the current property is static.
key()  : int|null
next()  : void
rewind()  : void
valid()  : bool

Properties

$index

private int $index = 0

index of the current propertyProperty to use

Methods

__construct()

Instantiates this iterator with the propertyNode to iterate.

public __construct(Property $property) : mixed
Parameters
$property : Property

getDefault()

returns the default value of the current property.

public getDefault() : Expr|null
Return values
Expr|null

getDocComment()

Gets the doc comment of the node.

public getDocComment() : Doc|null

The doc comment has to be the last comment associated with the node.

Return values
Doc|null

getEndLine()

Gets line the node started in.

public getEndLine() : int
Return values
int

getFqsen()

Returns the fqsen of the current property.

public getFqsen() : Fqsen
Return values
Fqsen

getHooks()

public getHooks() : array<string|int, PropertyHook>
Return values
array<string|int, PropertyHook>

getLine()

Gets line the node started in.

public getLine() : int
Return values
int

getName()

returns the name of the current property.

public getName() : string
Return values
string

getType()

Gets the type of the property.

public getType() : Identifier|Name|ComplexType|null
Return values
Identifier|Name|ComplexType|null

isAsymmetric()

Returns true when current property has asymetric accessors.

public isAsymmetric() : bool

This method will always return false when your phpparser version is < 5.2

Return values
bool

isPrivate()

returns true when the current property is private.

public isPrivate() : bool
Return values
bool

isPrivateSet()

Returns asymetric accessor value for current property.

public isPrivateSet() : bool

This method will return the same value as self::isPrivate() when your phpparser version is < 5.2

Return values
bool

isProtected()

returns true when the current property is protected.

public isProtected() : bool
Return values
bool

isProtectedSet()

Returns asymetric accessor value for current property.

public isProtectedSet() : bool

This method will return the same value as self::isProtected() when your phpparser version is < 5.2

Return values
bool

isPublic()

returns true when the current property is public.

public isPublic() : bool
Return values
bool

isPublicSet()

Returns asymmetric accessor value for current property.

public isPublicSet() : bool

This method will return the same value as self::isPublic() when your phpparser version is < 5.2

Return values
bool

isReadOnly()

returns true when the current property is readonly.

public isReadOnly() : bool
Return values
bool

isStatic()

returns true when the current property is static.

public isStatic() : bool
Return values
bool

        
On this page

Search results