Skip to content

Commit c5179f4

Browse files
committed
Fix get errors in PhpMDHandler
1 parent ebf810c commit c5179f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/PhpGitHooks/Infrastructure/PhpCsFixer/PhpCsFixerHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function run(array $messages)
7575
}
7676
}
7777

78-
if ($errors) {
78+
if (!empty($errors)) {
7979
$this->outputHandler->setError($this->getErrors($errors));
8080
$this->output->writeln($this->outputHandler->getError());
8181
$this->output->writeln(BadJobLogo::paint($messages[MessageConfigData::KEY_ERROR_MESSAGE]));

src/PhpGitHooks/Infrastructure/PhpMD/PhpMDHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ public function run(array $messages)
7474
}
7575

7676
$errors = array_filter($errors, function ($var) {
77-
return !is_null($var);
77+
return trim($var);
7878
});
7979

80-
if ($errors) {
80+
if (!empty($errors)) {
8181
$this->writeOutputError(
8282
new PHPMDViolationsException(implode('', $errors)),
8383
MessageConfigData::KEY_ERROR_MESSAGE

0 commit comments

Comments
 (0)