Skip to content

Commit 15031c5

Browse files
committed
[Console] fixed CS
1 parent b3b80c8 commit 15031c5

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

Helper/TableHelper.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -142,26 +142,26 @@ public function addRows(array $rows)
142142
public function addRow(array $row)
143143
{
144144
$this->rows[] = array_values($row);
145-
145+
146146
$keys = array_keys($this->rows);
147147
$rowKey = array_pop($keys);
148148

149149
foreach ($row as $key => $cellValue) {
150-
if (strstr($cellValue, "\n")) {
151-
152-
$lines = explode("\n", $cellValue);
153-
$this->rows[$rowKey][$key] = $lines[0];
154-
unset($lines[0]);
150+
if (!strstr($cellValue, "\n")) {
151+
continue;
152+
}
155153

156-
foreach ($lines as $lineKey => $line) {
154+
$lines = explode("\n", $cellValue);
155+
$this->rows[$rowKey][$key] = $lines[0];
156+
unset($lines[0]);
157157

158-
$nextRowKey = $rowKey + $lineKey + 1;
158+
foreach ($lines as $lineKey => $line) {
159+
$nextRowKey = $rowKey + $lineKey + 1;
159160

160-
if (isset($this->rows[$nextRowKey])) {
161-
$this->rows[$nextRowKey][$key] = $line;
162-
} else {
163-
$this->rows[$nextRowKey] = array($key => $line);
164-
}
161+
if (isset($this->rows[$nextRowKey])) {
162+
$this->rows[$nextRowKey][$key] = $line;
163+
} else {
164+
$this->rows[$nextRowKey] = array($key => $line);
165165
}
166166
}
167167
}

Tests/Helper/TableHelperTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public function testRenderProvider()
159159
array(
160160
array("99921-58-10-7", "Divine\nComedy", "Dante Alighieri"),
161161
array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."),
162+
array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."),
162163
array("960-425-059-0", "The Lord of the Rings", "J. R. R.\nTolkien"),
163164
),
164165
TableHelper::LAYOUT_DEFAULT,
@@ -170,6 +171,8 @@ public function testRenderProvider()
170171
| | Comedy | |
171172
| 9971-5-0210-2 | Harry Potter | Rowling |
172173
| | and the Chamber of Secrets | Joanne K. |
174+
| 9971-5-0210-2 | Harry Potter | Rowling |
175+
| | and the Chamber of Secrets | Joanne K. |
173176
| 960-425-059-0 | The Lord of the Rings | J. R. R. |
174177
| | | Tolkien |
175178
+---------------+----------------------------+-----------------+

0 commit comments

Comments
 (0)