Skip to content

Commit 889bfef

Browse files
author
Christian Scheb
committed
Only print "Error found" if there are any errors
1 parent 6cf0966 commit 889bfef

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ConsoleOutput.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ public function addError($description, $file, $line)
5050

5151
public function printAll()
5252
{
53-
$this->writeln('Errors found:'.PHP_EOL);
54-
foreach ($this->errors as $error) {
55-
$this->writeln($error['file'].' ('.$error['line'].'): '.$error['description']);
53+
if ($this->errors) {
54+
$this->writeln('Errors found:'.PHP_EOL);
55+
foreach ($this->errors as $error) {
56+
$this->writeln($error['file'].' ('.$error['line'].'): '.$error['description']);
57+
}
5658
}
5759
}
5860
}

0 commit comments

Comments
 (0)