Skip to content

Commit

Permalink
fix: unitialized proxy (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi authored Sep 18, 2024
1 parent 2da1964 commit 5de3422
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 1.3.1
## 1.3.2

* fix: handle cases where an uninitialized proxy gets a `postFlush` event.

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
],
"require": {
"doctrine/orm": "^2.16 || ^3.0",
"doctrine/persistence": "^2.4 || ^3.0",
"rekalogika/direct-property-access": "^1.1.2 || ^1.2",
"symfony/config": "^6.0 || ^7.0",
"symfony/dependency-injection": "^6.0 || ^7.0",
"symfony/http-kernel": "^6.0 || ^7.0",
"symfony/var-exporter": "^6.4 || ^7.1"
"symfony/http-kernel": "^6.0 || ^7.0"
},
"require-dev": {
"phpstan/phpstan": "^1.12",
Expand Down
7 changes: 2 additions & 5 deletions src/ReconstitutorProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Rekalogika\Reconstitutor;

use Doctrine\Persistence\Proxy;
use Rekalogika\Reconstitutor\Contract\ReconstitutorInterface;
use Rekalogika\Reconstitutor\Contract\ReconstitutorResolverInterface;
use Symfony\Component\VarExporter\LazyObjectInterface;

final class ReconstitutorProcessor
{
Expand Down Expand Up @@ -50,10 +50,7 @@ public function onLoad(object $object): void

public function onSave(object $object): void
{
if (
$object instanceof LazyObjectInterface
&& !$object->isLazyObjectInitialized()
) {
if ($object instanceof Proxy && !$object->__isInitialized()) {
return;
}

Expand Down

0 comments on commit 5de3422

Please sign in to comment.