Skip to content

Commit

Permalink
Merge pull request #706 from kylekatarnls/patch-1
Browse files Browse the repository at this point in the history
Add ReturnTypeWillChange to FrameCollection
  • Loading branch information
denis-sokolov committed Sep 19, 2021
2 parents a9a2267 + 29e7ca0 commit 7c7a85b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Whoops/Exception/FrameCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use ArrayIterator;
use Countable;
use IteratorAggregate;
use ReturnTypeWillChange;
use Serializable;
use UnexpectedValueException;

Expand Down Expand Up @@ -89,6 +90,7 @@ public function getArray()
* @see IteratorAggregate::getIterator
* @return ArrayIterator
*/
#[ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->frames);
Expand All @@ -98,6 +100,7 @@ public function getIterator()
* @see ArrayAccess::offsetExists
* @param int $offset
*/
#[ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->frames[$offset]);
Expand All @@ -107,6 +110,7 @@ public function offsetExists($offset)
* @see ArrayAccess::offsetGet
* @param int $offset
*/
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->frames[$offset];
Expand All @@ -116,6 +120,7 @@ public function offsetGet($offset)
* @see ArrayAccess::offsetSet
* @param int $offset
*/
#[ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
throw new \Exception(__CLASS__ . ' is read only');
Expand All @@ -125,6 +130,7 @@ public function offsetSet($offset, $value)
* @see ArrayAccess::offsetUnset
* @param int $offset
*/
#[ReturnTypeWillChange]
public function offsetUnset($offset)
{
throw new \Exception(__CLASS__ . ' is read only');
Expand All @@ -134,6 +140,7 @@ public function offsetUnset($offset)
* @see Countable::count
* @return int
*/
#[ReturnTypeWillChange]
public function count()
{
return count($this->frames);
Expand All @@ -155,6 +162,7 @@ public function countIsApplication()
* @see Serializable::serialize
* @return string
*/
#[ReturnTypeWillChange]
public function serialize()
{
return serialize($this->frames);
Expand All @@ -164,11 +172,22 @@ public function serialize()
* @see Serializable::unserialize
* @param string $serializedFrames
*/
#[ReturnTypeWillChange]
public function unserialize($serializedFrames)
{
$this->frames = unserialize($serializedFrames);
}

public function __serialize(): array
{
return $this->frames;
}

public function __unserialize(array $serializedFrames): void
{
$this->frames = $serializedFrames;
}

/**
* @param Frame[] $frames Array of Frame instances, usually from $e->getPrevious()
*/
Expand Down

0 comments on commit 7c7a85b

Please sign in to comment.