CompilerContext
in package
implements
CompilerContextInterface
Context class used in compiler passes to store the state of the nodes.
The Compiler is making changes to the nodes in a DocumentNode as the nodes are immutable cannot do this directly. This class helps to modify the nodes in the DocumentNode by creating a shadow tree.
The class is final and should not be extended, if you need to provide more information to the compiler pass you can use the CompilerContextInterface and decorate this class.
Tags
Table of Contents
Interfaces
Properties
- $projectNode : ProjectNode
- $shadowTree : TreeNode<string|int, Node>
Methods
- __construct() : mixed
- getDocumentNode() : DocumentNode
- getLoggerInformation() : array<string, string>
- getProjectNode() : ProjectNode
- getShadowTree() : TreeNode<string|int, Node>
- withDocumentShadowTree() : static
- withShadowTree() : static
Properties
$projectNode read-only
private
ProjectNode
$projectNode
$shadowTree
private
TreeNode<string|int, Node>
$shadowTree
Methods
__construct()
public
__construct(ProjectNode $projectNode) : mixed
Parameters
- $projectNode : ProjectNode
getDocumentNode()
public
getDocumentNode() : DocumentNode
Return values
DocumentNodegetLoggerInformation()
public
getLoggerInformation() : array<string, string>
Return values
array<string, string>getProjectNode()
public
getProjectNode() : ProjectNode
Return values
ProjectNodegetShadowTree()
public
getShadowTree() : TreeNode<string|int, Node>
Return values
TreeNode<string|int, Node>withDocumentShadowTree()
public
withDocumentShadowTree(DocumentNode $documentNode) : static
Parameters
- $documentNode : DocumentNode
Return values
staticwithShadowTree()
public
withShadowTree(TreeNode<string|int, Node> $shadowTree) : static