ExampleTableNode
extends TableNode
in package
Represents Gherkin Outline Example Table.
Tags
Table of Contents
Properties
- $keyword : string
- $maxLineLength : int
- $table : array<string|int, mixed>
- $tags : array<string|int, string>
Methods
- __construct() : mixed
- Initializes example table.
- __toString() : string
- Converts table into string
- fromList() : TableNode
- Creates a table from a given list.
- getColumn() : array<string|int, mixed>
- Returns specific column in a table.
- getColumnsHash() : array<string|int, mixed>
- Returns table hash, formed by columns.
- getHash() : array<string|int, mixed>
- Returns table hash, formed by columns (ColumnsHash).
- getIterator() : Iterator
- Retrieves a hash iterator.
- getKeyword() : string
- Returns example table keyword.
- getLine() : int
- Returns line number at which table was started.
- getLines() : array<string|int, mixed>
- Returns table definition lines.
- getNodeType() : string
- Returns node type string
- getRow() : array<string|int, mixed>
- Returns specific row in a table.
- getRowAsString() : string
- Converts row into delimited string.
- getRowAsStringWithWrappedValues() : string
- Converts row into delimited string.
- getRowLine() : int
- Returns line number at which specific row was defined.
- getRows() : array<string|int, mixed>
- Returns table rows.
- getRowsHash() : array<string|int, mixed>
- Returns table hash, formed by rows.
- getTable() : array<string|int, mixed>
- Returns numerated table lines.
- getTableAsString() : string
- Converts entire table into string
- getTags() : array<string|int, string>
- Returns attached tags
- mergeRowsFromTable() : mixed
- Obtains and adds rows from another table to the current table.
- padRight() : string
- Pads string right.
Properties
$keyword
private
string
$keyword
$maxLineLength
private
int
$maxLineLength
= array()
$table
private
array<string|int, mixed>
$table
$tags
private
array<string|int, string>
$tags
Methods
__construct()
Initializes example table.
public
__construct(array<string|int, mixed> $table, string $keyword[, array<string|int, string> $tags = array() ]) : mixed
Parameters
- $table : array<string|int, mixed>
-
Table in form of [$rowLineNumber => [$val1, $val2, $val3]]
- $keyword : string
- $tags : array<string|int, string> = array()
__toString()
Converts table into string
public
__toString() : string
Return values
stringfromList()
Creates a table from a given list.
public
static fromList(array<string|int, mixed> $list) : TableNode
Parameters
- $list : array<string|int, mixed>
-
One-dimensional array
Tags
Return values
TableNodegetColumn()
Returns specific column in a table.
public
getColumn(int $index) : array<string|int, mixed>
Parameters
- $index : int
-
Column number
Tags
Return values
array<string|int, mixed>getColumnsHash()
Returns table hash, formed by columns.
public
getColumnsHash() : array<string|int, mixed>
Return values
array<string|int, mixed>getHash()
Returns table hash, formed by columns (ColumnsHash).
public
getHash() : array<string|int, mixed>
Return values
array<string|int, mixed>getIterator()
Retrieves a hash iterator.
public
getIterator() : Iterator
Attributes
Return values
IteratorgetKeyword()
Returns example table keyword.
public
getKeyword() : string
Return values
stringgetLine()
Returns line number at which table was started.
public
getLine() : int
Return values
intgetLines()
Returns table definition lines.
public
getLines() : array<string|int, mixed>
Return values
array<string|int, mixed>getNodeType()
Returns node type string
public
getNodeType() : string
Return values
stringgetRow()
Returns specific row in a table.
public
getRow(int $index) : array<string|int, mixed>
Parameters
- $index : int
-
Row number
Tags
Return values
array<string|int, mixed>getRowAsString()
Converts row into delimited string.
public
getRowAsString(int $rowNum) : string
Parameters
- $rowNum : int
-
Row number
Return values
stringgetRowAsStringWithWrappedValues()
Converts row into delimited string.
public
getRowAsStringWithWrappedValues(int $rowNum, callable $wrapper) : string
Parameters
- $rowNum : int
-
Row number
- $wrapper : callable
-
Wrapper function
Return values
stringgetRowLine()
Returns line number at which specific row was defined.
public
getRowLine(int $index) : int
Parameters
- $index : int
Tags
Return values
intgetRows()
Returns table rows.
public
getRows() : array<string|int, mixed>
Return values
array<string|int, mixed>getRowsHash()
Returns table hash, formed by rows.
public
getRowsHash() : array<string|int, mixed>
Return values
array<string|int, mixed>getTable()
Returns numerated table lines.
public
getTable() : array<string|int, mixed>
Line numbers are keys, lines are values.
Return values
array<string|int, mixed>getTableAsString()
Converts entire table into string
public
getTableAsString() : string
Return values
stringgetTags()
Returns attached tags
public
getTags() : array<string|int, string>
Return values
array<string|int, string>mergeRowsFromTable()
Obtains and adds rows from another table to the current table.
public
mergeRowsFromTable(TableNode $node) : mixed
The second table should have the same structure as the current one.
Parameters
- $node : TableNode
Tags
padRight()
Pads string right.
protected
padRight(string $text, int $length) : string
Parameters
- $text : string
-
Text to pad
- $length : int
-
Length