diff --git a/src/Composer/DependencyResolver/Decisions.php b/src/Composer/DependencyResolver/Decisions.php index 648b533dff1c..e69d1a00d975 100644 --- a/src/Composer/DependencyResolver/Decisions.php +++ b/src/Composer/DependencyResolver/Decisions.php @@ -142,31 +142,37 @@ public function revertLast() array_pop($this->decisionQueue); } + #[\ReturnTypeWillChange] public function count() { return \count($this->decisionQueue); } + #[\ReturnTypeWillChange] public function rewind() { end($this->decisionQueue); } + #[\ReturnTypeWillChange] public function current() { return current($this->decisionQueue); } + #[\ReturnTypeWillChange] public function key() { return key($this->decisionQueue); } + #[\ReturnTypeWillChange] public function next() { prev($this->decisionQueue); } + #[\ReturnTypeWillChange] public function valid() { return false !== current($this->decisionQueue); diff --git a/src/Composer/DependencyResolver/RuleSet.php b/src/Composer/DependencyResolver/RuleSet.php index aff0d4c6515c..0ac2bd762509 100644 --- a/src/Composer/DependencyResolver/RuleSet.php +++ b/src/Composer/DependencyResolver/RuleSet.php @@ -98,6 +98,7 @@ public function add(Rule $rule, $type) } } + #[\ReturnTypeWillChange] public function count() { return $this->nextRuleId; @@ -116,6 +117,7 @@ public function getRules() /** * @return RuleSetIterator */ + #[\ReturnTypeWillChange] public function getIterator() { return new RuleSetIterator($this->getRules()); diff --git a/src/Composer/DependencyResolver/RuleSetIterator.php b/src/Composer/DependencyResolver/RuleSetIterator.php index 50d72dc93a36..e755572a06ad 100644 --- a/src/Composer/DependencyResolver/RuleSetIterator.php +++ b/src/Composer/DependencyResolver/RuleSetIterator.php @@ -33,16 +33,19 @@ public function __construct(array $rules) $this->rewind(); } + #[\ReturnTypeWillChange] public function current() { return $this->rules[$this->currentType][$this->currentOffset]; } + #[\ReturnTypeWillChange] public function key() { return $this->currentType; } + #[\ReturnTypeWillChange] public function next() { $this->currentOffset++; @@ -67,6 +70,7 @@ public function next() } } + #[\ReturnTypeWillChange] public function rewind() { $this->currentOffset = 0; @@ -86,6 +90,7 @@ public function rewind() } while (isset($this->types[$this->currentTypeOffset]) && !\count($this->rules[$this->currentType])); } + #[\ReturnTypeWillChange] public function valid() { return isset($this->rules[$this->currentType], $this->rules[$this->currentType][$this->currentOffset]); diff --git a/src/Composer/Util/ErrorHandler.php b/src/Composer/Util/ErrorHandler.php index 7c25fbae4f42..915bc3fb5576 100644 --- a/src/Composer/Util/ErrorHandler.php +++ b/src/Composer/Util/ErrorHandler.php @@ -52,8 +52,8 @@ public static function handle($level, $message, $file, $line) } if (self::$io) { - // ignore symfony/console deprecation warning - if (0 === strpos($message, 'Return type of Symfony\\Component\\Console\\Helper\\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator')) { + // ignore symfony/* deprecation warnings about return types + if (preg_match('{^Return type of Symfony\\Component\\.*ReturnTypeWillChange}', $message)) { return true; }