Skip to content

Commit

Permalink
Remove getCode usage as it is not type safe apparently, see phpstan/p…
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Dec 30, 2021
1 parent 09d1330 commit 84f8fda
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/Composer/DependencyResolver/SolverProblemsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ public function __construct(array $problems, array $learnedPool)
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
Expand Down
6 changes: 3 additions & 3 deletions src/Composer/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ protected function doUpdate(InstalledRepositoryInterface $localRepo, $doInstall)
$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);
Expand Down Expand Up @@ -633,7 +633,7 @@ protected function extractDevPackages(LockTransaction $lockTransaction, Platform
$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);
Expand Down Expand Up @@ -703,7 +703,7 @@ protected function doInstall(InstalledRepositoryInterface $localRepo, $alreadySo
$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());
}
}

Expand Down

0 comments on commit 84f8fda

Please sign in to comment.