🚨 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,8 +77,11 @@ class SolverProblemsException extends \RuntimeException
|
||||||
{
|
{
|
||||||
foreach ($reasonSets as $reasonSet) {
|
foreach ($reasonSets as $reasonSet) {
|
||||||
foreach ($reasonSet as $reason) {
|
foreach ($reasonSet as $reason) {
|
||||||
if (isset($reason["rule"]) && 0 === strpos($reason["rule"]->getRequiredPackage(), 'ext-')) {
|
if (isset($reason["rule"])) {
|
||||||
return true;
|
$requiredPackage = $reason["rule"]->getRequiredPackage();
|
||||||
|
if ($requiredPackage !== null && 0 === strpos($requiredPackage, 'ext-')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue