Documentation

ElementNameResolver extends NodeVisitorAbstract
in package

Table of Contents

$parts  : SplDoublyLinkedList
__construct()  : mixed
afterTraverse()  : null|array<string|int, Node>
Called once after traversal.
beforeTraverse()  : null|array<string|int, Node>
Resets the object to a known state before start processing.
enterNode()  : null|int|Node
Adds fqsen property to a node when applicable.
leaveNode()  : null|int|Node|array<string|int, Node>
Performs a reset of the added element when needed.
buildName()  : string
Builds the name of the current node using the parts that are pushed to the parts list.
resetState()  : void
Resets the state of the object to an empty state.
setFqsen()  : void

Properties

Methods

afterTraverse()

Called once after traversal.

public afterTraverse(array<string|int, mixed> $nodes) : null|array<string|int, Node>

Return value semantics:

  • null: $nodes stays as-is
  • otherwise: $nodes is set to the return value
Parameters
$nodes : array<string|int, mixed>

Array of nodes

Return values
null|array<string|int, Node>

Array of nodes

beforeTraverse()

Resets the object to a known state before start processing.

public beforeTraverse(array<string|int, mixed> $nodes) : null|array<string|int, Node>
Parameters
$nodes : array<string|int, mixed>

Array of nodes

Tags
inheritDoc
Return values
null|array<string|int, Node>

Array of nodes

enterNode()

Adds fqsen property to a node when applicable.

public enterNode(Node $node) : null|int|Node
Parameters
$node : Node

Node

Tags
todo

this method is decorating the Node with an $fqsen property... since we can't declare it in PhpParser/NodeAbstract, we should add a decorator class wrapper in Reflection... that should clear up the PHPSTAN errors about "access to an undefined property ::$fqsen".

Return values
null|int|Node

Replacement node (or special return value)

leaveNode()

Performs a reset of the added element when needed.

public leaveNode(Node $node) : null|int|Node|array<string|int, Node>
Parameters
$node : Node

Node

Tags
inheritDoc
Return values
null|int|Node|array<string|int, Node>

Replacement node (or special return value)

buildName()

Builds the name of the current node using the parts that are pushed to the parts list.

private buildName() : string
Return values
string

resetState()

Resets the state of the object to an empty state.

private resetState([string|null $namespace = null ]) : void
Parameters
$namespace : string|null = null
Return values
void

Search results