Skip to content

Commit

Permalink
Add PHP 8.1 Compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ElGigi committed Nov 26, 2021
1 parent 211647f commit a95b312
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This projec
to [Semantic Versioning] (http://semver.org/). For change log format,
use [Keep a Changelog] (http://keepachangelog.com/).

## [1.0.0-beta3] - 2021-11-26

### Added

- PHP 8.1 Compatibility

## [1.0.0-beta2] - 2020-11-05

### Added
Expand Down
20 changes: 15 additions & 5 deletions src/Debug/Atlas.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,32 @@ public function getTemplateName(): string
return '@Berlioz-AtlasPackage/Twig/Debug/atlas.html.twig';
}

public function __serialize(): array
{
return [
'queries' => $this->queries
];
}

public function __unserialize(array $data): void
{
$this->queries = $data['queries'] ?? [];
}

/**
* @inheritdoc
*/
public function serialize()
{
return serialize(['queries' => $this->queries]);
return serialize($this->__serialize());
}

/**
* @inheritdoc
*/
public function unserialize($serialized)
{
$unserialized = unserialize($serialized);

$this->queries = $unserialized['queries'] ?? [];
$this->__unserialize(unserialize($serialized));
}

///////////////////////////
Expand All @@ -134,7 +144,7 @@ public function unserialize($serialized)
/**
* @inheritdoc
*/
public function count()
public function count(): int
{
return count($this->getQueries());
}
Expand Down

0 comments on commit a95b312

Please sign in to comment.