PHP Class Spatie\Php7to5\NodeVisitors\AnonymousClassReplacer

Inheritance: extends PhpParser\NodeVisitorAbstract
ファイルを表示 Open project: spatie/7to5

Protected Properties

Property Type Description
$anonymousClassNodes array

Public Methods

Method Description
afterTraverse ( array $nodes )
convertToPhp5Statements ( array $php7statements ) : PhpParser\Node[]
leaveNode ( PhpParser\Node $node )

Protected Methods

Method Description
getAnonymousClassHookIndex ( array $statements ) : integer Find the index of the first statement that is not a declare, use or namespace statement.
moveAnonymousClassesToHook ( array $nodes, $hookIndex, $anonymousClassStatements ) : array

Method Details

afterTraverse() public method

public afterTraverse ( array $nodes )
$nodes array

convertToPhp5Statements() public method

public convertToPhp5Statements ( array $php7statements ) : PhpParser\Node[]
$php7statements array
return PhpParser\Node[]

getAnonymousClassHookIndex() protected method

Find the index of the first statement that is not a declare, use or namespace statement.
protected getAnonymousClassHookIndex ( array $statements ) : integer
$statements array
return integer

leaveNode() public method

public leaveNode ( PhpParser\Node $node )
$node PhpParser\Node

moveAnonymousClassesToHook() protected method

protected moveAnonymousClassesToHook ( array $nodes, $hookIndex, $anonymousClassStatements ) : array
$nodes array
$hookIndex
$anonymousClassStatements
return array

Property Details

$anonymousClassNodes protected_oe property

protected array $anonymousClassNodes
return array