Skip to content

Commit 1f0f88d

Browse files
committed
Phpmd error msg fix
1 parent b9abd9b commit 1f0f88d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,20 @@ private function execute($file, $options)
5757
*
5858
* @return null|string
5959
*/
60+
61+
/**
62+
* @param Process $process
63+
*
64+
* @return null|string
65+
*
66+
* @throws \Symfony\Component\Process\Exception\LogicException
67+
*/
6068
private function setError(Process $process)
6169
{
62-
return false === $process->isSuccessful() ? $process->getErrorOutput() : null;
70+
if (false === $process->isSuccessful()) {
71+
return $process->getErrorOutput() ?: $process->getOutput();
72+
}
73+
74+
return null;
6375
}
6476
}

0 commit comments

Comments
 (0)