Fix #19041: Fix PHP 8.1 issues

This commit is contained in:
Alexander Makarov
2022-01-14 13:52:01 +03:00
committed by GitHub
parent 4bd551d143
commit 1271bc419f
49 changed files with 162 additions and 53 deletions

View File

@@ -1477,6 +1477,7 @@ class ArrayAccessibleObject implements ArrayAccess
$this->container = $container;
}
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
@@ -1486,16 +1487,19 @@ class ArrayAccessibleObject implements ArrayAccess
}
}
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return array_key_exists($offset, $this->container);
}
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->offsetExists($offset) ? $this->container[$offset] : null;
@@ -1519,26 +1523,31 @@ class TraversableArrayAccessibleObject extends ArrayAccessibleObject implements
return array_key_exists($keyIndex, $keys) ? $keys[$keyIndex] : false;
}
#[\ReturnTypeWillChange]
public function rewind()
{
$this->position = 0;
}
#[\ReturnTypeWillChange]
public function current()
{
return $this->offsetGet($this->getContainerKey($this->position));
}
#[\ReturnTypeWillChange]
public function key()
{
return $this->getContainerKey($this->position);
}
#[\ReturnTypeWillChange]
public function next()
{
++$this->position;
}
#[\ReturnTypeWillChange]
public function valid()
{
$key = $this->getContainerKey($this->position);