From 17a082ed137d644128625d84c59873089411a642 Mon Sep 17 00:00:00 2001 From: Robert Purcell Date: Fri, 21 Apr 2023 15:52:40 -0400 Subject: [PATCH] Align the percentage output Left pad with whitespace so that the 100% line doesn't pop out of alignment. --- src/Outputs/TextOutput.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Outputs/TextOutput.php b/src/Outputs/TextOutput.php index c471a15..f08a2ab 100644 --- a/src/Outputs/TextOutput.php +++ b/src/Outputs/TextOutput.php @@ -194,9 +194,9 @@ protected function writeMark($type) protected function writePercent() { - $percent = floor($this->checkedFiles / $this->totalFileCount * 100); + $percent = $this->stringWidth(floor($this->checkedFiles / $this->totalFileCount * 100), 3); $current = $this->stringWidth($this->checkedFiles, strlen($this->totalFileCount)); - $this->writeLine(" $current/$this->totalFileCount ($percent %)"); + $this->writeLine(" $current/$this->totalFileCount ($percent%)"); } /**