TableRow
extends AbstractBlock
in package
Block-level element
Table of Contents
- $data : array<string, mixed>
- Used for storage of arbitrary data.
- $depth : int
- $endLine : int
- $firstChild : Node|null
- $lastChild : Node|null
- $lastLineBlank : bool
- $next : Node|null
- $open : bool
- $parent : Node|null
- $previous : Node|null
- $startLine : int
- __clone() : mixed
- Clone the current node and its children
- appendChild() : void
- canContain() : bool
- Returns true if this block can contain the given block as a child node
- children() : array<string|int, AbstractBlock>
- detach() : void
- detachChildren() : void
- Detaches all child nodes of given node
- endsWithBlankLine() : bool
- Whether the block ends with a blank line
- finalize() : void
- Finalize the block; mark it closed for modification
- firstChild() : Node|null
- getData() : mixed
- getDepth() : int
- getEndLine() : int
- getStartLine() : int
- hasChildren() : bool
- insertAfter() : void
- Inserts the $sibling node after $this
- insertBefore() : void
- Inserts the $sibling node before $this
- isCode() : bool
- Whether this is a code block
- isContainer() : bool
- isOpen() : bool
- Whether the block is open for modifications
- lastChild() : Node|null
- matchesNextLine() : bool
- next() : Node|null
- parent() : Node|null
- parent() :
- prependChild() : void
- Adds $child as the very first child of $this
- previous() : Node|null
- replaceChildren() : $this
- Replace all children of given node with collection of another
- replaceWith() : void
- setEndLine() : $this
- setLastLineBlank() : void
- setStartLine() : $this
- shouldLastLineBeBlank() : bool
- Determines whether the last line should be marked as blank
- walker() : NodeWalker
- setParent() : void
Properties
$data
Used for storage of arbitrary data.
public
array<string, mixed>
$data
= []
$depth
protected
int
$depth
= 0
$endLine
protected
int
$endLine
= 0
$firstChild
protected
Node|null
$firstChild
$lastChild
protected
Node|null
$lastChild
$lastLineBlank
protected
bool
$lastLineBlank
= false
$next
protected
Node|null
$next
$open
protected
bool
$open
= true
$parent
protected
Node|null
$parent
$previous
protected
Node|null
$previous
$startLine
protected
int
$startLine
= 0
Methods
__clone()
Clone the current node and its children
public
__clone() : mixed
WARNING: This is a recursive function and should not be called on deeply-nested node trees!
Return values
mixed —appendChild()
public
appendChild(Node $child) : void
Parameters
- $child : Node
Return values
void —canContain()
Returns true if this block can contain the given block as a child node
public
canContain(AbstractBlock $block) : bool
Parameters
- $block : AbstractBlock
Return values
bool —children()
public
children() : array<string|int, AbstractBlock>
Return values
array<string|int, AbstractBlock> —detach()
public
detach() : void
Return values
void —detachChildren()
Detaches all child nodes of given node
public
detachChildren() : void
Return values
void —endsWithBlankLine()
Whether the block ends with a blank line
public
endsWithBlankLine() : bool
Return values
bool —finalize()
Finalize the block; mark it closed for modification
public
finalize(ContextInterface $context, int $endLineNumber) : void
Parameters
- $context : ContextInterface
- $endLineNumber : int
Return values
void —firstChild()
public
firstChild() : Node|null
Return values
Node|null —getData()
public
getData(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
Return values
mixed —getDepth()
public
getDepth() : int
Return values
int —getEndLine()
public
getEndLine() : int
Return values
int —getStartLine()
public
getStartLine() : int
Return values
int —hasChildren()
public
hasChildren() : bool
Return values
bool —insertAfter()
Inserts the $sibling node after $this
public
insertAfter(Node $sibling) : void
Parameters
- $sibling : Node
Return values
void —insertBefore()
Inserts the $sibling node before $this
public
insertBefore(Node $sibling) : void
Parameters
- $sibling : Node
Return values
void —isCode()
Whether this is a code block
public
isCode() : bool
Code blocks are extra-greedy - they'll try to consume all subsequent lines of content without calling matchesNextLine() each time.
Return values
bool —isContainer()
public
abstract isContainer() : bool
Return values
bool —isOpen()
Whether the block is open for modifications
public
isOpen() : bool
Return values
bool —lastChild()
public
lastChild() : Node|null
Return values
Node|null —matchesNextLine()
public
matchesNextLine(Cursor $cursor) : bool
Parameters
- $cursor : Cursor
Return values
bool —next()
public
next() : Node|null
Return values
Node|null —parent()
public
parent() : Node|null
Return values
Node|null —parent()
public
parent() :
?AbstractBlock
Return values
—prependChild()
Adds $child as the very first child of $this
public
prependChild(Node $child) : void
Parameters
- $child : Node
Return values
void —previous()
public
previous() : Node|null
Return values
Node|null —replaceChildren()
Replace all children of given node with collection of another
public
replaceChildren(iteratable<string|int, Node> $children) : $this
Parameters
- $children : iteratable<string|int, Node>
Return values
$this —replaceWith()
public
replaceWith(Node $replacement) : void
Parameters
- $replacement : Node
Return values
void —setEndLine()
public
setEndLine(int $endLine) : $this
Parameters
- $endLine : int
Return values
$this —setLastLineBlank()
public
setLastLineBlank(bool $blank) : void
Parameters
- $blank : bool
Return values
void —setStartLine()
public
setStartLine(int $startLine) : $this
Parameters
- $startLine : int
Return values
$this —shouldLastLineBeBlank()
Determines whether the last line should be marked as blank
public
shouldLastLineBeBlank(Cursor $cursor, int $currentLineNumber) : bool
Parameters
- $cursor : Cursor
- $currentLineNumber : int
Return values
bool —walker()
public
walker() : NodeWalker
Return values
NodeWalker —setParent()
protected
setParent([Node|null $node = null ]) : void
Parameters
- $node : Node|null = null