Skip to content

Commit 2c25343

Browse files
authored
Merge pull request #116 from mmarynich/feature/phpmd-err-output
Phpmd error msg fix
2 parents b9abd9b + 91fcad8 commit 2c25343

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/PhpGitHooks/Module/PhpMd/Infrastructure/Tool/PhpMdToolProcessor.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,15 @@ private function execute($file, $options)
5656
* @param Process $process
5757
*
5858
* @return null|string
59+
*
60+
* @throws \Symfony\Component\Process\Exception\LogicException
5961
*/
6062
private function setError(Process $process)
6163
{
62-
return false === $process->isSuccessful() ? $process->getErrorOutput() : null;
64+
if (false === $process->isSuccessful()) {
65+
return $process->getErrorOutput() ?: $process->getOutput();
66+
}
67+
68+
return null;
6369
}
6470
}

0 commit comments

Comments
 (0)