Skip to content

Commit 0f1f05f

Browse files
authored
Merge pull request #4613 from Laravel-Backpack/fix-str-repeat-error
fix str_repeat error
2 parents d196626 + dec7d87 commit 0f1f05f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/Console/Commands/Traits/PrettyCommandOutput.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,11 @@ public function progressBlock(string $text, string $progress = 'running', string
185185
$this->maxWidth = $this->maxWidth ?? 128;
186186
$this->terminal = $this->terminal ?? new Terminal();
187187
$width = min($this->terminal->getWidth(), $this->maxWidth);
188+
$dotLength = $width - 5 - strlen(strip_tags($text.$progress));
188189

189190
$this->output->write(sprintf(
190191
" $text <fg=gray>%s</> <fg=$color>%s</>",
191-
str_repeat('.', $width - 5 - strlen(strip_tags($text.$progress))),
192+
str_repeat('.', ($dotLength < 1) ? 1 : $dotLength),
192193
strtoupper($progress)
193194
));
194195
}

0 commit comments

Comments
 (0)