diff --git a/bin/composer-dependency-analyser b/bin/composer-dependency-analyser index a93a61d..f79b4f4 100755 --- a/bin/composer-dependency-analyser +++ b/bin/composer-dependency-analyser @@ -53,7 +53,7 @@ try { InvalidCliException $e ) { $stdErrPrinter->printLine("\n{$e->getMessage()}" . PHP_EOL); - exit(255); + exit(1); } catch (AbortException $e) { exit(0); diff --git a/src/Result/ConsoleFormatter.php b/src/Result/ConsoleFormatter.php index 67402dc..68af02d 100644 --- a/src/Result/ConsoleFormatter.php +++ b/src/Result/ConsoleFormatter.php @@ -211,7 +211,7 @@ private function printResultErrors( $this->printRunSummary($result); - return $hasError ? 255 : 0; + return $hasError ? 1 : 0; } /** diff --git a/src/Result/JunitFormatter.php b/src/Result/JunitFormatter.php index bf94816..7f3b1c0 100644 --- a/src/Result/JunitFormatter.php +++ b/src/Result/JunitFormatter.php @@ -131,7 +131,7 @@ public function format( $this->printer->print($this->prettyPrintXml($xml)); if ($hasError) { - return 255; + return 1; } return 0; diff --git a/tests/BinTest.php b/tests/BinTest.php index daf16a6..a884f4e 100644 --- a/tests/BinTest.php +++ b/tests/BinTest.php @@ -32,19 +32,19 @@ public function test(): void $this->runCommand('php bin/composer-dependency-analyser', $rootDir, 0, $okOutput, $usingConfig); $this->runCommand('php bin/composer-dependency-analyser --verbose', $rootDir, 0, $okOutput, $usingConfig); - $this->runCommand('php ../bin/composer-dependency-analyser', $testsDir, 255, null, $noComposerJsonError); + $this->runCommand('php ../bin/composer-dependency-analyser', $testsDir, 1, null, $noComposerJsonError); $this->runCommand('php bin/composer-dependency-analyser --help', $rootDir, 0, $helpOutput); $this->runCommand('php ../bin/composer-dependency-analyser --help', $testsDir, 0, $helpOutput); $this->runCommand('php ../bin/composer-dependency-analyser --version', $testsDir, 0, $versionOutput); $this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json', $rootDir, 0, $okOutput, $usingConfig); - $this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.lock', $rootDir, 255, null, $noPackagesError); - $this->runCommand('php bin/composer-dependency-analyser --composer-json=README.md', $rootDir, 255, null, $parseError); - $this->runCommand('php ../bin/composer-dependency-analyser --composer-json=composer.json', $testsDir, 255, null, $noComposerJsonError); + $this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.lock', $rootDir, 1, null, $noPackagesError); + $this->runCommand('php bin/composer-dependency-analyser --composer-json=README.md', $rootDir, 1, null, $parseError); + $this->runCommand('php ../bin/composer-dependency-analyser --composer-json=composer.json', $testsDir, 1, null, $noComposerJsonError); $this->runCommand('php ../bin/composer-dependency-analyser --composer-json=../composer.json --config=../composer-dependency-analyser.php', $testsDir, 0, $okOutput, $usingConfig); $this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json --format=console', $rootDir, 0, $okOutput, $usingConfig); $this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json --format=console --dump-usages=symfony/*', $rootDir, 1, $dumpingOutput, $usingConfig); $this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json --format=junit', $rootDir, 0, $junitOutput, $usingConfig); - $this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json --format=junit --dump-usages=symfony/*', $rootDir, 255, null, $junitDumpError); + $this->runCommand('php bin/composer-dependency-analyser --composer-json=composer.json --format=junit --dump-usages=symfony/*', $rootDir, 1, null, $junitDumpError); } private function runCommand(