SectionCreationTransformer
in package
implements
NodeTransformer
FinalYes
Table of Contents
Interfaces
Properties
- $firstLevel : int
- $sectionStack : array<string|int, SectionNode>
Methods
- enterNode() : T
- getPriority() : int
- The higher the priority the earlier the NodeTransformer is executed.
- leaveNode() : T|null
- supports() : bool
- pushNewSectionToStack() : void
- Pushes the new section to the stack.
Properties
$firstLevel
private
int
$firstLevel
= 1
$sectionStack
private
array<string|int, SectionNode>
$sectionStack
= []
Methods
enterNode()
public
enterNode(Node $node, CompilerContextInterface $compilerContext) : T
Parameters
- $node : Node
- $compilerContext : CompilerContextInterface
Return values
TgetPriority()
The higher the priority the earlier the NodeTransformer is executed.
public
getPriority() : int
Return values
intleaveNode()
public
leaveNode(Node $node, CompilerContextInterface $compilerContext) : T|null
Parameters
- $node : Node
- $compilerContext : CompilerContextInterface
Return values
T|nullsupports()
public
supports(Node $node) : bool
Parameters
- $node : Node
Return values
boolpushNewSectionToStack()
Pushes the new section to the stack.
private
pushNewSectionToStack(SectionNode $newSection) : void
The stack is used to track the current level of nodes and adding child nodes to the section. As not all documentation formats are using the correct level of title nodes we need to track the level of the first title node to determine the correct level of the section.
Parameters
- $newSection : SectionNode