Skip to content

Commit

Permalink
Fix unserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGuilloux committed Dec 26, 2021
1 parent 375c30f commit 5b3ff1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Changelog

## Version 1.0.1

- Remove un-serialization class filtering to avoid errors.
5 changes: 1 addition & 4 deletions src/DefinitionRegistry/DefinitionRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
namespace NicolasGuilloux\PhpunitDependencyInjectionBundle\DefinitionRegistry;

use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;

class DefinitionRegistry implements DefinitionRegistryInterface
{
public const SERIALIZATION_ALLOWED_CLASSES = [Definition::class, Reference::class];

/** @var array<string, Definition> */
protected $definitions = [];

public function setDefinitions(array $serializedDefinitions): void
{
$options = ['allowed_classes' => self::SERIALIZATION_ALLOWED_CLASSES];
$options = ['allowed_classes' => true];

foreach ($serializedDefinitions as $class => $serializedDefinition) {
$this->definitions[$class] = unserialize($serializedDefinition, $options);
Expand Down

0 comments on commit 5b3ff1b

Please sign in to comment.