Skip to content

Commit c356178

Browse files
authored
Merge pull request #1221 from PHPCSStandards/phpcs-4.0/feature/modernize-use-null-coalesce
Modernize: use null coalesce
2 parents bedaab5 + 169b187 commit c356178

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/Generators/Text.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,8 @@ private function linesToTableRows(array $column1Lines, array $column2Lines)
220220

221221
$rows = '';
222222
for ($i = 0; $i < $maxLines; $i++) {
223-
$column1Text = '';
224-
if (isset($column1Lines[$i]) === true) {
225-
$column1Text = $column1Lines[$i];
226-
}
227-
228-
$column2Text = '';
229-
if (isset($column2Lines[$i]) === true) {
230-
$column2Text = $column2Lines[$i];
231-
}
223+
$column1Text = ($column1Lines[$i] ?? '');
224+
$column2Text = ($column2Lines[$i] ?? '');
232225

233226
$rows .= '| ';
234227
$rows .= $column1Text.str_repeat(' ', max(0, (47 - strlen($column1Text))));

0 commit comments

Comments
 (0)