Skip to content

Commit de26471

Browse files
committed
Use the new exit code when scanning code from STDIN
For now, always return a zero-exit code when the fixer runs on code provided via STDIN. This should be re-evaluated at a later time to see if we can get this to use the `ExitCode::calculate()` method as well.
1 parent 7dcdab2 commit de26471

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Reports/Cbf.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use PHP_CodeSniffer\Exceptions\DeepExitException;
1717
use PHP_CodeSniffer\Files\File;
18+
use PHP_CodeSniffer\Util\ExitCode;
1819
use PHP_CodeSniffer\Util\Timing;
1920
use PHP_CodeSniffer\Util\Writers\StatusWriter;
2021

@@ -60,7 +61,7 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false,
6061
// even if nothing was fixed. Exit here because we
6162
// can't process any more than 1 file in this setup.
6263
$fixedContent = $phpcsFile->fixer->getContents();
63-
throw new DeepExitException($fixedContent, 1);
64+
throw new DeepExitException($fixedContent, ExitCode::OKAY);
6465
}
6566

6667
if ($errors === 0) {

0 commit comments

Comments
 (0)