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); + } + } }