More php8.1 deprecation fixes, refs #10008

main
Jordi Boggiano 3 years ago
parent 47cf602f9e
commit a7efb27338
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -142,31 +142,37 @@ class Decisions implements \Iterator, \Countable
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);

@ -98,6 +98,7 @@ class RuleSet implements \IteratorAggregate, \Countable
}
}
#[\ReturnTypeWillChange]
public function count()
{
return $this->nextRuleId;
@ -116,6 +117,7 @@ class RuleSet implements \IteratorAggregate, \Countable
/**
* @return RuleSetIterator
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return new RuleSetIterator($this->getRules());

@ -33,16 +33,19 @@ class RuleSetIterator implements \Iterator
$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 @@ class RuleSetIterator implements \Iterator
}
}
#[\ReturnTypeWillChange]
public function rewind()
{
$this->currentOffset = 0;
@ -86,6 +90,7 @@ class RuleSetIterator implements \Iterator
} 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]);

@ -52,8 +52,8 @@ class ErrorHandler
}
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;
}

Loading…
Cancel
Save