Skip to content

Commit 02c1b3e

Browse files
lubianaadhocore
authored andcommitted
maybe fix test
1 parent 5dbde8b commit 02c1b3e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Output/Writer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ public function justify(string $first, ?string $second = null, array $options =
322322
];
323323

324324
$second = (string) $second;
325-
$dashWidth = $this->terminal->width() - (strlen($first) + strlen($second));
325+
$terminalWidth = $this->terminal->width() ?? 80;
326+
$dashWidth = $terminalWidth - (strlen($first) + strlen($second));
326327
// remove left and right margins because we're going to add 1 space on each side (after/before the text).
327328
// if we don't have a second element, we just remove the left margin
328329
$dashWidth -= $second === '' ? 1 : 2;

0 commit comments

Comments
 (0)