Skip to content

Commit

Permalink
check immutability on unserialize
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Jun 6, 2019
1 parent b27cd14 commit 03d0260
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"require": {
"php": "^7.1",
"ext-json": "*",
"phpgears/immutability": "~0.1",
"phpgears/immutability": "~0.1.5",
"ramsey/uuid": "^3.7"
},
"require-dev": {
Expand Down
5 changes: 3 additions & 2 deletions src/AbstractIdentity.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ final public function serialize(): string
*/
final public function unserialize($serialized): void
{
$this->value = \unserialize($serialized, [static::class]);
$this->alreadyConstructed = true;
$this->checkImmutability();

$this->value = \unserialize($serialized, ['allowed_classes' => false]);
}

/**
Expand Down

0 comments on commit 03d0260

Please sign in to comment.