🚨 Fix `strpos()` deprecation notice with `null` (#11310)
Deprecation Notice: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in composer/src/Composer/DependencyResolver/SolverProblemsException.php:80pull/11609/head
parent
9c86ff9fff
commit
1997bb8f36
|
@ -77,11 +77,14 @@ class SolverProblemsException extends \RuntimeException
|
|||
{
|
||||
foreach ($reasonSets as $reasonSet) {
|
||||
foreach ($reasonSet as $reason) {
|
||||
if (isset($reason["rule"]) && 0 === strpos($reason["rule"]->getRequiredPackage(), 'ext-')) {
|
||||
if (isset($reason["rule"])) {
|
||||
$requiredPackage = $reason["rule"]->getRequiredPackage();
|
||||
if ($requiredPackage !== null && 0 === strpos($requiredPackage, 'ext-')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue