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

Commit 63df36a

Browse files
authored
Merge pull request #10 from karriereat/bugfix/handle-phpcbf-exit-codes
Handle PHPCBF exit codes correctly
2 parents 029268d + 892dde2 commit 63df36a

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)