Add ReturnTypeWillChange to FrameCollection

Fix PHP 8.1 compatibility
This commit is contained in:
Kyle
2021-09-19 13:52:38 +02:00
committed by GitHub
parent a9a22670bf
commit a767384f4e
+9
View File
@@ -10,6 +10,7 @@ use ArrayAccess;
use ArrayIterator;
use Countable;
use IteratorAggregate;
use ReturnTypeWillChange;
use Serializable;
use UnexpectedValueException;
@@ -89,6 +90,7 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
* @see IteratorAggregate::getIterator
* @return ArrayIterator
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->frames);
@@ -98,6 +100,7 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
* @see ArrayAccess::offsetExists
* @param int $offset
*/
#[ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->frames[$offset]);
@@ -107,6 +110,7 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
* @see ArrayAccess::offsetGet
* @param int $offset
*/
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->frames[$offset];
@@ -116,6 +120,7 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
* @see ArrayAccess::offsetSet
* @param int $offset
*/
#[ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
throw new \Exception(__CLASS__ . ' is read only');
@@ -125,6 +130,7 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
* @see ArrayAccess::offsetUnset
* @param int $offset
*/
#[ReturnTypeWillChange]
public function offsetUnset($offset)
{
throw new \Exception(__CLASS__ . ' is read only');
@@ -134,6 +140,7 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
* @see Countable::count
* @return int
*/
#[ReturnTypeWillChange]
public function count()
{
return count($this->frames);
@@ -155,6 +162,7 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
* @see Serializable::serialize
* @return string
*/
#[ReturnTypeWillChange]
public function serialize()
{
return serialize($this->frames);
@@ -164,6 +172,7 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
* @see Serializable::unserialize
* @param string $serializedFrames
*/
#[ReturnTypeWillChange]
public function unserialize($serializedFrames)
{
$this->frames = unserialize($serializedFrames);