Upgrade to 3.6.0

This commit is contained in:
Bastian Allgeier
2021-11-16 14:53:37 +01:00
parent 7388fa4d24
commit 92b7a330fa
318 changed files with 20017 additions and 6878 deletions

View File

@@ -241,6 +241,15 @@ class Frame implements Serializable
return serialize($frame);
}
public function __serialize()
{
$frame = $this->frame;
if (!empty($this->comments)) {
$frame['_comments'] = $this->comments;
}
return $frame;
}
/**
* Unserializes the frame data, while also preserving
* any existing comment data.
@@ -260,6 +269,16 @@ class Frame implements Serializable
$this->frame = $frame;
}
public function __unserialize($frame)
{
if (!empty($frame['_comments'])) {
$this->comments = $frame['_comments'];
unset($frame['_comments']);
}
$this->frame = $frame;
}
/**
* Compares Frame against one another
* @param Frame $frame

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,11 +172,22 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
* @see Serializable::unserialize
* @param string $serializedFrames
*/
#[ReturnTypeWillChange]
public function unserialize($serializedFrames)
{
$this->frames = unserialize($serializedFrames);
}
public function __serialize()
{
return $this->frames;
}
public function __unserialize(array $serializedFrames)
{
$this->frames = $serializedFrames;
}
/**
* @param Frame[] $frames Array of Frame instances, usually from $e->getPrevious()
*/