diff --git a/src/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php b/src/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php index 9359c57affaa..43cc33469bb5 100644 --- a/src/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php +++ b/src/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php @@ -39,7 +39,7 @@ final class IgnoreListPlatformRequirementFilter implements PlatformRequirementFi */ public function __construct(array $reqList) { - $ignoreAll = $ignoreUpperBound = array(); + $ignoreAll = $ignoreUpperBound = []; foreach ($reqList as $req) { if (substr($req, -1) === '+') { $ignoreUpperBound[] = substr($req, 0, -1); @@ -51,11 +51,7 @@ public function __construct(array $reqList) $this->ignoreUpperBoundRegex = BasePackage::packageNamesToRegexp($ignoreUpperBound); } - /** - * @param string $req - * @return bool - */ - public function isIgnored($req) + public function isIgnored(string $req): bool { if (!PlatformRepository::isPlatformPackage($req)) { return false; @@ -65,11 +61,9 @@ public function isIgnored($req) } /** - * @param string $req - * @return ConstraintInterface * @param bool $allowUpperBoundOverride For conflicts we do not want the upper bound to be skipped */ - public function filterConstraint($req, ConstraintInterface $constraint, $allowUpperBoundOverride = true) + public function filterConstraint(string $req, ConstraintInterface $constraint, bool $allowUpperBoundOverride = true): ConstraintInterface { if (!PlatformRepository::isPlatformPackage($req)) { return $constraint; @@ -86,7 +80,7 @@ public function filterConstraint($req, ConstraintInterface $constraint, $allowUp $intervals = Intervals::get($constraint); $last = end($intervals['numeric']); if ($last !== false && (string) $last->getEnd() !== (string) Interval::untilPositiveInfinity()) { - $constraint = new MultiConstraint(array($constraint, new Constraint('>=', $last->getEnd()->getVersion())), false); + $constraint = new MultiConstraint([$constraint, new Constraint('>=', $last->getEnd()->getVersion())], false); } return $constraint;