Skip to content

Commit cff5648

Browse files
authored
Remove reserved exit code 255 and replace it with exit code 1 (#214)
1 parent f374f53 commit cff5648

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

bin/composer-dependency-analyser

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ try {
5353
InvalidCliException $e
5454
) {
5555
$stdErrPrinter->printLine("\n<red>{$e->getMessage()}</red>" . PHP_EOL);
56-
exit(255);
56+
exit(1);
5757

5858
} catch (AbortException $e) {
5959
exit(0);

src/Result/ConsoleFormatter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ private function printResultErrors(
211211

212212
$this->printRunSummary($result);
213213

214-
return $hasError ? 255 : 0;
214+
return $hasError ? 1 : 0;
215215
}
216216

217217
/**

src/Result/JunitFormatter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function format(
131131
$this->printer->print($this->prettyPrintXml($xml));
132132

133133
if ($hasError) {
134-
return 255;
134+
return 1;
135135
}
136136

137137
return 0;

tests/BinTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ public function test(): void
3232

3333
$this->runCommand('php bin/composer-dependency-analyser', $rootDir, 0, $okOutput, $usingConfig);
3434
$this->runCommand('php bin/composer-dependency-analyser --verbose', $rootDir, 0, $okOutput, $usingConfig);
35-
$this->runCommand('php ../bin/composer-dependency-analyser', $testsDir, 255, null, $noComposerJsonError);
35+
$this->runCommand('php ../bin/composer-dependency-analyser', $testsDir, 1, null, $noComposerJsonError);
3636
$this->runCommand('php bin/composer-dependency-analyser --help', $rootDir, 0, $helpOutput);
3737
$this->runCommand('php ../bin/composer-dependency-analyser --help', $testsDir, 0, $helpOutput);
3838
$this->runCommand('php ../bin/composer-dependency-analyser --version', $testsDir, 0, $versionOutput);
3939
$this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json', $rootDir, 0, $okOutput, $usingConfig);
40-
$this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.lock', $rootDir, 255, null, $noPackagesError);
41-
$this->runCommand('php bin/composer-dependency-analyser --composer-json=README.md', $rootDir, 255, null, $parseError);
42-
$this->runCommand('php ../bin/composer-dependency-analyser --composer-json=composer.json', $testsDir, 255, null, $noComposerJsonError);
40+
$this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.lock', $rootDir, 1, null, $noPackagesError);
41+
$this->runCommand('php bin/composer-dependency-analyser --composer-json=README.md', $rootDir, 1, null, $parseError);
42+
$this->runCommand('php ../bin/composer-dependency-analyser --composer-json=composer.json', $testsDir, 1, null, $noComposerJsonError);
4343
$this->runCommand('php ../bin/composer-dependency-analyser --composer-json=../composer.json --config=../composer-dependency-analyser.php', $testsDir, 0, $okOutput, $usingConfig);
4444
$this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json --format=console', $rootDir, 0, $okOutput, $usingConfig);
4545
$this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json --format=console --dump-usages=symfony/*', $rootDir, 1, $dumpingOutput, $usingConfig);
4646
$this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json --format=junit', $rootDir, 0, $junitOutput, $usingConfig);
47-
$this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json --format=junit --dump-usages=symfony/*', $rootDir, 255, null, $junitDumpError);
47+
$this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json --format=junit --dump-usages=symfony/*', $rootDir, 1, null, $junitDumpError);
4848
}
4949

5050
private function runCommand(

0 commit comments

Comments
 (0)