diff --git a/src/Console/Command/Compile.php b/src/Console/Command/Compile.php index 2fc7a6581..adfb9b775 100644 --- a/src/Console/Command/Compile.php +++ b/src/Console/Command/Compile.php @@ -209,7 +209,7 @@ protected function executeCommand(IO $io): int return $this->generateDockerFile($io); } - return 0; + return self::SUCCESS; } private function createPhar( diff --git a/src/Console/Command/Diff.php b/src/Console/Command/Diff.php index 39b52c7d4..4ffbb5c5c 100644 --- a/src/Console/Command/Diff.php +++ b/src/Console/Command/Diff.php @@ -126,7 +126,7 @@ protected function executeCommand(IO $io): int ), ); - return 1; + return self::FAILURE; } $result1 = $this->compareArchives($diff, $io); @@ -166,7 +166,7 @@ private function compareArchives(PharDiff $diff, IO $io): int if ($pharInfoA->equals($pharInfoB)) { $io->success('The two archives are identical'); - return 0; + return self::SUCCESS; } self::renderArchive( @@ -183,7 +183,7 @@ private function compareArchives(PharDiff $diff, IO $io): int $io, ); - return 1; + return self::FAILURE; } private function compareContents(PharDiff $diff, IO $io): int @@ -207,14 +207,14 @@ private function compareContents(PharDiff $diff, IO $io): int if (null === $diffResult || [[], []] === $diffResult) { $io->success('The contents are identical'); - return 0; + return self::SUCCESS; } if (is_string($diffResult)) { // Git or GNU diff: we don't have much control on the format $io->writeln($diffResult); - return 1; + return self::FAILURE; } $io->writeln(sprintf( @@ -266,7 +266,7 @@ private function compareContents(PharDiff $diff, IO $io): int count($diffResult[0]) + count($diffResult[1]), )); - return 1; + return self::FAILURE; } private static function renderArchive(string $fileName, PharInfo $pharInfo, IO $io): void diff --git a/src/Console/Command/Extract.php b/src/Console/Command/Extract.php index 399181969..d64109f5f 100644 --- a/src/Console/Command/Extract.php +++ b/src/Console/Command/Extract.php @@ -63,13 +63,13 @@ protected function executeCommand(IO $io): int $outputDir = $io->getInput()->getArgument(self::OUTPUT_ARG); if (null === $filePath) { - return 1; + return self::FAILURE; } [$box, $cleanUpTmpPhar] = $this->getBox($filePath, $io); if (null === $box) { - return 1; + return self::FAILURE; } $restoreLimit = bump_open_file_descriptor_limit(count($box), $io); @@ -84,10 +84,10 @@ protected function executeCommand(IO $io): int } catch (RuntimeException $exception) { $io->error($exception->getMessage()); - return 1; + return self::FAILURE; } - return 0; + return self::SUCCESS; } private static function getPharFilePath(IO $io): ?string diff --git a/src/Console/Command/GenerateDockerFile.php b/src/Console/Command/GenerateDockerFile.php index 074d8bc43..a2a53f06d 100644 --- a/src/Console/Command/GenerateDockerFile.php +++ b/src/Console/Command/GenerateDockerFile.php @@ -61,7 +61,7 @@ protected function executeCommand(IO $io): int $pharFilePath = $this->getPharFilePath($io); if (null === $pharFilePath) { - return 1; + return self::FAILURE; } Assert::file($pharFilePath); @@ -174,7 +174,7 @@ private function generateFile(string $pharFilePath, string $requirementsPhar, IO .'requirement checker enabled.', ); - return 1; + return self::FAILURE; } $requirements = include $requirementsPhar; @@ -196,7 +196,7 @@ private function generateFile(string $pharFilePath, string $requirementsPhar, IO if (false === $remove) { $io->writeln('Skipped the docker file generation.'); - return 0; + return self::SUCCESS; } } @@ -214,6 +214,6 @@ private function generateFile(string $pharFilePath, string $requirementsPhar, IO ], ); - return 0; + return self::SUCCESS; } } diff --git a/src/Console/Command/Info.php b/src/Console/Command/Info.php index e747755dc..4b903bed5 100644 --- a/src/Console/Command/Info.php +++ b/src/Console/Command/Info.php @@ -139,7 +139,7 @@ public function executeCommand(IO $io): int ), ); - return 1; + return self::FAILURE; } $tmpFile = create_temporary_phar($fileRealPath); @@ -179,7 +179,7 @@ public function showInfo(string $file, string $originalFile, IO $io): int ), ); - return 1; + return self::FAILURE; } } @@ -213,7 +213,7 @@ private static function showGlobalInfo(IO $io): int $io->newLine(); $io->comment('Get a PHAR details by giving its path as an argument.'); - return 0; + return self::SUCCESS; } private function showPharInfo( @@ -240,7 +240,7 @@ private function showPharInfo( $io->comment('Use the --list|-l option to list the content of the PHAR.'); } - return 0; + return self::SUCCESS; } private function showPharMeta(PharInfo $pharInfo, IO $io): void diff --git a/src/Console/Command/Process.php b/src/Console/Command/Process.php index 5dfb9c03d..2c5d61777 100644 --- a/src/Console/Command/Process.php +++ b/src/Console/Command/Process.php @@ -157,7 +157,7 @@ protected function executeCommand(IO $io): int } } - return 0; + return self::SUCCESS; } private static function retrieveCompactors(Configuration $config): Compactors