From da8d105556240346726517a61c8bdb23cf9f28c4 Mon Sep 17 00:00:00 2001 From: celexon Date: Mon, 25 Nov 2019 14:00:24 +0100 Subject: [PATCH] Update Printer.php - Fix method signature on several methods (missing void) - Add method writeWithColor - compatible with PHPUnit 8.4.3 --- src/Printer.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Printer.php b/src/Printer.php index 6a371d7..3a60aa5 100644 --- a/src/Printer.php +++ b/src/Printer.php @@ -57,7 +57,7 @@ public function __construct( /** * {@inheritdoc} */ - protected function writeProgress($progress) + protected function writeProgress($progress) :void { if ($this->debug) { parent::writeProgress($progress); @@ -72,7 +72,7 @@ protected function writeProgress($progress) /** * {@inheritdoc} */ - protected function writeProgressWithColor($color, $buffer) + protected function writeProgressWithColor($color, $buffer): void { if ($this->debug) { parent::writeProgressWithColor($color, $buffer); @@ -112,14 +112,14 @@ private function printTestCaseStatus($color, $buffer) break; } - echo parent::formatWithColor($color, $buffer); + $this->writeWithColor($color, $buffer); $this->column++; } /** * {@inheritdoc} */ - public function startTest(Test $test) + public function startTest(Test $test): void { $this->className = get_class($test); parent::startTest($test); @@ -185,4 +185,17 @@ private function isCIEnvironment() return false; } + + + /** + * {@inheritdoc} + */ + protected function writeWithColor(string $color, string $buffer, bool $lf = true): void + { + $this->write($this->colorizeTextBox($color, $buffer)); + + if ($lf) { + $this->write(\PHP_EOL); + } + } }