HumHub Documentation (unofficial)

TableNode
in package
implements ArgumentInterface, IteratorAggregate

Represents Gherkin Table argument.

Tags
author

Konstantin Kudryashov ever.zet@gmail.com

Table of Contents

Interfaces

ArgumentInterface
Gherkin arguments interface.
IteratorAggregate

Properties

$maxLineLength  : int
$table  : array<string|int, mixed>

Methods

__construct()  : mixed
Initializes 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.
getLine()  : int
Returns line number at which table was started.
getLines()  : array<string|int, mixed>
Returns table definition lines.
getNodeType()  : string
Returns node type.
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
mergeRowsFromTable()  : mixed
Obtains and adds rows from another table to the current table.
padRight()  : string
Pads string right.

Properties

$maxLineLength

private int $maxLineLength = array()

$table

private array<string|int, mixed> $table

Methods

__construct()

Initializes table.

public __construct(array<string|int, mixed> $table) : mixed
Parameters
$table : array<string|int, mixed>

Table in form of [$rowLineNumber => [$val1, $val2, $val3]]

Tags
throws
NodeException

If the given table is invalid

__toString()

Converts table into string

public __toString() : string
Return values
string

fromList()

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
throws
NodeException

If the given list is not a one-dimensional array

Return values
TableNode

getColumn()

Returns specific column in a table.

public getColumn(int $index) : array<string|int, mixed>
Parameters
$index : int

Column number

Tags
throws
NodeException

If column with specified index does not exist

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>

getLine()

Returns line number at which table was started.

public getLine() : int
Return values
int

getLines()

Returns table definition lines.

public getLines() : array<string|int, mixed>
Return values
array<string|int, mixed>

getNodeType()

Returns node type.

public getNodeType() : string
Return values
string

getRow()

Returns specific row in a table.

public getRow(int $index) : array<string|int, mixed>
Parameters
$index : int

Row number

Tags
throws
NodeException

If row with specified index does not exist

Return values
array<string|int, mixed>

getRowAsString()

Converts row into delimited string.

public getRowAsString(int $rowNum) : string
Parameters
$rowNum : int

Row number

Return values
string

getRowAsStringWithWrappedValues()

Converts row into delimited string.

public getRowAsStringWithWrappedValues(int $rowNum, callable $wrapper) : string
Parameters
$rowNum : int

Row number

$wrapper : callable

Wrapper function

Return values
string

getRowLine()

Returns line number at which specific row was defined.

public getRowLine(int $index) : int
Parameters
$index : int
Tags
throws
NodeException

If row with specified index does not exist

Return values
int

getRows()

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
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
deprecated

remove together with OutlineNode::getExampleTable

padRight()

Pads string right.

protected padRight(string $text, int $length) : string
Parameters
$text : string

Text to pad

$length : int

Length

Return values
string

        
On this page

Search results