Skip to content
This repository was archived by the owner on Dec 14, 2020. It is now read-only.

Commit 892dde2

Browse files
author
Jakob Linskeseder
committed
Handle PHPCBF exit codes correctly
The previously used code-fixer returned different exit codes. With PHPCBF, we don't have to handle exit codes at all, since the result (success, error) is printed on the command line.
1 parent 029268d commit 892dde2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/CodeStyleFixer.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ public static function run(Event $event)
3232

3333
$composerIO->write($process->getOutput());
3434

35-
$exitCode = $process->getExitCode();
36-
37-
if ($exitCode !== ComposerScriptInterface::EXIT_CODE_OK) {
38-
throw new ProcessFailedException($process);
39-
}
40-
41-
return $exitCode;
35+
// PHPCBF exit codes:
36+
// 0 = Nothing was fixed by PHPCBF.
37+
// 1 = PHPCBF fixed all fixable errors.
38+
// 2 = PHPCBF fixed some fixable errors, but others failed to fix.
39+
return $process->getExitCode();
4240
}
4341
}

0 commit comments

Comments
 (0)