Skip to content

Commit 8be39ac

Browse files
authored
Merge pull request #117 from mmarynich/feature/phpcs-err-output
Phpcs error message fix
2 parents 2c25343 + 4db6871 commit 8be39ac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/PhpGitHooks/Module/PhpCs/Infrastructure/Tool/PhpCsToolProcessor.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ private function execute($file, $standard, $ignore)
6464
/**
6565
* @param Process $process
6666
*
67-
* @return string
67+
* @return null|string
68+
*
69+
* @throws \Symfony\Component\Process\Exception\LogicException
6870
*/
6971
private function setErrors(Process $process)
7072
{
7173
if (false === $process->isSuccessful()) {
72-
return $process->getErrorOutput();
74+
return $process->getErrorOutput() ?: $process->getOutput();
7375
}
76+
77+
return null;
7478
}
7579
}

0 commit comments

Comments
 (0)