SimpleTableRule
in package
implements
Rule
FinalYes
Table of Contents
Interfaces
Constants
- PRIORITY = 40
Properties
- $logger : LoggerInterface
- $productions : RuleContainer
Methods
- __construct() : mixed
- applies() : bool
- apply() : TNode|null
- Enters this state and loops through all relevant lines until a Node is produced.
- createColumn() : TableColumn
- getColumnDefinition() : array<string|int, array{start: int, length: int|null}>
- isColspanDefinition() : bool
- isColumnDefinitionLine() : bool
- startsWithBlankCell() : bool
- tryParseRow() : TableRow
Constants
PRIORITY
public
mixed
PRIORITY
= 40
Properties
$logger read-only
private
LoggerInterface
$logger
$productions read-only
private
RuleContainer
$productions
Methods
__construct()
public
__construct(RuleContainer $productions, LoggerInterface $logger) : mixed
Parameters
- $productions : RuleContainer
- $logger : LoggerInterface
applies()
public
applies(BlockContext $blockContext) : bool
Parameters
- $blockContext : BlockContext
Return values
boolapply()
Enters this state and loops through all relevant lines until a Node is produced.
public
apply(BlockContext $blockContext[, CompoundNode|null $on = null ]) : TNode|null
Parameters
- $blockContext : BlockContext
- $on : CompoundNode|null = null
Return values
TNode|nullcreateColumn()
private
createColumn(string $content, BlockContext $blockContext, int $colspan) : TableColumn
Parameters
- $content : string
- $blockContext : BlockContext
- $colspan : int
Return values
TableColumngetColumnDefinition()
private
getColumnDefinition(string $line) : array<string|int, array{start: int, length: int|null}>
Parameters
- $line : string
Return values
array<string|int, array{start: int, length: int|null}>isColspanDefinition()
private
isColspanDefinition(string|null $line) : bool
Parameters
- $line : string|null
Return values
boolisColumnDefinitionLine()
private
isColumnDefinitionLine(string $line) : bool
Parameters
- $line : string
Return values
boolstartsWithBlankCell()
private
startsWithBlankCell(LinesIterator $documentIterator, array{start: int, length: int|null} $columnDefinition) : bool
Parameters
- $documentIterator : LinesIterator
- $columnDefinition : array{start: int, length: int|null}
Return values
booltryParseRow()
private
tryParseRow(BlockContext $blockContext, array<string|int, array{start: int, length: int|null}> $columnDefinitions) : TableRow
Parameters
- $blockContext : BlockContext
- $columnDefinitions : array<string|int, array{start: int, length: int|null}>