1
0
Fork 0

Fix usage of getRequiredPackage, closes #10052

pull/10065/head
Jordi Boggiano 2021-08-18 14:29:49 +02:00
parent b232ee6663
commit cfe718fa43
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 5 additions and 1 deletions

View File

@ -76,6 +76,9 @@ abstract class Rule
return $this->reasonData;
}
/**
* @return ?string
*/
public function getRequiredPackage()
{
$reason = $this->getReason();

View File

@ -108,7 +108,8 @@ class SolverProblemsException extends \RuntimeException
{
foreach ($reasonSets as $reasonSet) {
foreach ($reasonSet as $rule) {
if (0 === strpos($rule->getRequiredPackage(), 'ext-')) {
$required = $rule->getRequiredPackage();
if (null !== $required && 0 === strpos($required, 'ext-')) {
return true;
}
}