diff --git a/src/Composer/DependencyResolver/SolverProblemsException.php b/src/Composer/DependencyResolver/SolverProblemsException.php index 128fbe146..27deac4b3 100644 --- a/src/Composer/DependencyResolver/SolverProblemsException.php +++ b/src/Composer/DependencyResolver/SolverProblemsException.php @@ -39,6 +39,14 @@ class SolverProblemsException extends \RuntimeException parent::__construct('Failed resolving dependencies with '.count($problems).' problems, call getPrettyString to get formatted details', self::ERROR_DEPENDENCY_RESOLUTION_FAILED); } + /** + * @return self::ERROR_DEPENDENCY_RESOLUTION_FAILED + */ + public function getExitCode() + { + return self::ERROR_DEPENDENCY_RESOLUTION_FAILED; + } + /** * @param bool $isVerbose * @param bool $isDevExtraction diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index c78dc8fd7..78329042d 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -455,7 +455,7 @@ class Installer $ghe = new GithubActionError($this->io); $ghe->emit($err."\n".$prettyProblem); - return max(self::ERROR_GENERIC_FAILURE, $e->getCode()); + return max(self::ERROR_GENERIC_FAILURE, $e->getExitCode()); } $this->io->writeError("Analyzed ".count($pool)." packages to resolve dependencies", true, IOInterface::VERBOSE); @@ -633,7 +633,7 @@ class Installer $ghe = new GithubActionError($this->io); $ghe->emit($err."\n".$prettyProblem); - return max(self::ERROR_GENERIC_FAILURE, $e->getCode()); + return max(self::ERROR_GENERIC_FAILURE, $e->getExitCode()); } $lockTransaction->setNonDevPackages($nonDevLockTransaction); @@ -703,7 +703,7 @@ class Installer $ghe = new GithubActionError($this->io); $ghe->emit($err."\n".$prettyProblem); - return max(self::ERROR_GENERIC_FAILURE, $e->getCode()); + return max(self::ERROR_GENERIC_FAILURE, $e->getExitCode()); } }