Guides

GridTableBuilder
in package
uses ReportsViolations

FinalYes

Table of Contents

Properties

$logger  : LoggerInterface|ViolationReporter

Methods

__construct()  : mixed
buildNode()  : TableNode|null
compile()  : TableNode
Finds the cells of the table as rectangles of borders, the way docutils does: each cell starts at a "+" corner and ends at the first "+" to the right, below and on the way back that close a rectangle. The row and column of a cell, and how many rows and columns it spans, follow from where its borders lie among the borders of all cells.
buildColumn()  : TableColumn
buildRow()  : TableRow
cellContent()  : string
isBottomBorder()  : bool
reportViolation()  : void
scanCell()  : array{int, int}|null
scanCells()  : array<int, array{int, int, int, int}>
scanDown()  : int|null
separators()  : array<int, int>
Numbers the borders that cells start or end at, in the order they appear in.

Properties

Methods

compile()

Finds the cells of the table as rectangles of borders, the way docutils does: each cell starts at a "+" corner and ends at the first "+" to the right, below and on the way back that close a rectangle. The row and column of a cell, and how many rows and columns it spans, follow from where its borders lie among the borders of all cells.

protected compile(ParserContext $context) : TableNode
Parameters
$context : ParserContext
Return values
TableNode

cellContent()

private cellContent(array<int, array<int, string>> $grid, int $top, int $left, int $bottom, int $right) : string
Parameters
$grid : array<int, array<int, string>>
$top : int
$left : int
$bottom : int
$right : int
Return values
string

isBottomBorder()

private isBottomBorder(array<int, array<int, string>> $grid, int $top, int $left, int $bottom, int $right) : bool
Parameters
$grid : array<int, array<int, string>>
$top : int
$left : int
$bottom : int
$right : int
Return values
bool

scanCell()

private scanCell(array<int, array<int, string>> $grid, int $top, int $left) : array{int, int}|null
Parameters
$grid : array<int, array<int, string>>
$top : int
$left : int
Return values
array{int, int}|null —

the bottom and right border of the cell starting at this corner

scanCells()

private scanCells(array<int, array<int, string>> $grid, ParserContext $context) : array<int, array{int, int, int, int}>
Parameters
$grid : array<int, array<int, string>>
$context : ParserContext
Return values
array<int, array{int, int, int, int}> —

the top, left, bottom and right border of each cell

scanDown()

private scanDown(array<int, array<int, string>> $grid, int $top, int $left, int $right) : int|null
Parameters
$grid : array<int, array<int, string>>
$top : int
$left : int
$right : int
Return values
int|null

separators()

Numbers the borders that cells start or end at, in the order they appear in.

private separators(array<int, array{int, int, int, int}> $cells, int $start, int $end) : array<int, int>
Parameters
$cells : array<int, array{int, int, int, int}>
$start : int
$end : int
Return values
array<int, int> —

the number of each border, by its position

On this page

Search results