\App\Console\TranslationTranslationFileNodeVisitor

NodeVisitor expecting a simple PHP file with a return statement and a nested associative array of strings.

This NodeVisitor is able to add or modify array nodes using an array of nested keys.

Summary

Methods
Properties
Constants
__construct()
beforeTraverse()
enterNode()
leaveNode()
afterTraverse()
No public properties found
No constants found
getCurrentKey()
nextKey()
previousKey()
isKeyLast()
$keys
$newValue
$keysPosition
$found
N/A
No private methods found
No private properties found
N/A

Properties

$keys

$keys : array<mixed,string>

Keys to search for

Type

array<mixed,string>

$newValue

$newValue : string|null

Type

string|null

$keysPosition

$keysPosition : integer|null

Type

integer|null

$found

$found : boolean

Type

boolean

Methods

__construct()

__construct(array<mixed,string>  $keys, string|null  $newValue) 

TranslationFileNodeVisitor constructor.

Parameters

array<mixed,string> $keys
string|null $newValue

Null if the node is supposed to be removed.

beforeTraverse()

beforeTraverse(array  $nodes) : null|array<mixed,\PhpParser\Node>|void

Parameters

array $nodes

Returns

null|array<mixed,\PhpParser\Node>|void

enterNode()

enterNode(\PhpParser\Node  $node) : integer|null|\PhpParser\Node

Parameters

\PhpParser\Node $node

Returns

integer|null|\PhpParser\Node

leaveNode()

leaveNode(\PhpParser\Node  $node) : false|integer|null|\PhpParser\Node|array<mixed,\PhpParser\Node>|void

Parameters

\PhpParser\Node $node

Returns

false|integer|null|\PhpParser\Node|array<mixed,\PhpParser\Node>|void

afterTraverse()

afterTraverse(array  $nodes) : null|array<mixed,\PhpParser\Node>|void

Parameters

array $nodes

Returns

null|array<mixed,\PhpParser\Node>|void

getCurrentKey()

getCurrentKey() : string|null

Returns

string|null

nextKey()

nextKey() : string|null

Returns

string|null

previousKey()

previousKey() : string|null

Returns

string|null

isKeyLast()

isKeyLast() : boolean

Returns

boolean