Documentation

TableParser extends AbstractBlockContinueParser
in package
implements BlockContinueParserWithInlinesInterface

FinalYes

Base class for a block parser

Slightly more convenient to extend from vs. implementing the interface

Table of Contents

Interfaces

BlockContinueParserWithInlinesInterface
Interface for a block continuation parser

Properties

$block  : Table
$bodyLines  : ArrayCollection<string|int, string>
$columns  : array<int, string|null>
$headerCells  : array<int, string>
$nextIsSeparatorLine  : bool
$remainingAutocompletedCells  : int

Methods

__construct()  : mixed
addLine()  : void
Add the given line of text to the current block
canContain()  : bool
Determine whether the current block being parsed can contain the given child block
canHaveLazyContinuationLines()  : bool
Return whether we are interested in possibly lazily parsing any subsequent lines
closeBlock()  : void
Close and finalize the current block
getBlock()  : Table
Return the current block being parsed by this parser
isContainer()  : bool
Return whether we are parsing a container block
parseInlines()  : void
Parse any inlines inside of the current block
tryContinue()  : BlockContinue|null
Attempt to parse the given line
parseCell()  : TableCell

Properties

$bodyLines

private ArrayCollection<string|int, string> $bodyLines
Tags
psalm-readonly-allow-private-mutation

$columns

private array<int, string|null> $columns
Tags
psalm-var

array<int, TableCell::ALIGN_*|null>

phpstan-var

array<int, TableCell::ALIGN_*|null>

psalm-readonly

$headerCells

private array<int, string> $headerCells
Tags
psalm-readonly-allow-private-mutation

$nextIsSeparatorLine

private bool $nextIsSeparatorLine = true
Tags
psalm-readonly-allow-private-mutation

$remainingAutocompletedCells

private int $remainingAutocompletedCells

Methods

__construct()

public __construct(array<int, string|null> $columns, array<int, string> $headerCells[, int $remainingAutocompletedCells = self::DEFAULT_MAX_AUTOCOMPLETED_CELLS ]) : mixed
Parameters
$columns : array<int, string|null>
$headerCells : array<int, string>
$remainingAutocompletedCells : int = self::DEFAULT_MAX_AUTOCOMPLETED_CELLS
Tags
psalm-param

array<int, TableCell::ALIGN_*|null> $columns

phpstan-param

array<int, TableCell::ALIGN_*|null> $columns

addLine()

Add the given line of text to the current block

public addLine(string $line) : void
Parameters
$line : string

canHaveLazyContinuationLines()

Return whether we are interested in possibly lazily parsing any subsequent lines

public canHaveLazyContinuationLines() : bool
Return values
bool

getBlock()

Return the current block being parsed by this parser

public getBlock() : Table
Return values
Table

        
On this page

Search results