bug #14980 Fixed fluent interface (jaytaph)

This PR was submitted for the 2.7 branch but it was merged into the 2.6 branch instead (closes #14980).

Discussion
----------

Fixed fluent interface

Small fix for fluent interface break when adding a single `TableSeparator` instance.

| Q             | A
| ------------- | ---
| Bug fix?      | [yes]
| New feature?  | [no]
| BC breaks?    | [no]
| Deprecations? | [no]
| Tests pass?   | [yes]
| Fixed tickets | #14981 14981
| License       | MIT
| Doc PR        |

Commits
-------

138f4a9 Fixed fluent interface
This commit is contained in:
Tobias Schultze 2015-06-16 20:12:58 +02:00
commit da662497f0
2 changed files with 7 additions and 5 deletions

View File

@ -165,7 +165,7 @@ class Table
if ($row instanceof TableSeparator) {
$this->rows[] = $row;
return;
return $this;
}
if (!is_array($row)) {

View File

@ -179,10 +179,10 @@ TABLE
array(
array('ISBN', 'Title', 'Author'),
array(
array("99921-58-10-7", "Divine\nComedy", "Dante Alighieri"),
array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."),
array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."),
array("960-425-059-0", "The Lord of the Rings", "J. R. R.\nTolkien"),
array('99921-58-10-7', "Divine\nComedy", 'Dante Alighieri'),
array('9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."),
array('9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."),
array('960-425-059-0', 'The Lord of the Rings', "J. R. R.\nTolkien"),
),
'default',
<<<TABLE
@ -341,6 +341,8 @@ TABLE;
TABLE;
$this->assertEquals($expected, $this->getOutputContent($output));
$this->assertEquals($table, $table->addRow(new TableSeparator()), 'fluent interface on addRow() with a single TableSeparator() works');
}
protected function getOutputStream()