Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doctrine/orm and fix deprecation #546

Open
wants to merge 1 commit into
base: 1.11
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"sylius/resource": "self.version"
},
"require-dev": {
"doctrine/orm": "^2.5",
"doctrine/orm": "^2.14",
"lchrusciel/api-test-case": "^5.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.2.1",
"pagerfanta/pagerfanta": "^3.0",
Expand All @@ -77,7 +77,7 @@
"rector/rector": "^0.13.5"
},
"suggest": {
"doctrine/orm": "^2.5",
"doctrine/orm": "^2.14",
"sylius/locale": "^1.0"
},
"config": {
Expand Down
4 changes: 2 additions & 2 deletions src/Bundle/EventListener/ORMTranslatableListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
namespace Sylius\Bundle\ResourceBundle\EventListener;

use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
use Doctrine\ORM\Event\PostLoadEventArgs;
use Doctrine\ORM\Events;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
Expand Down Expand Up @@ -69,7 +69,7 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void
}
}

public function postLoad(LifecycleEventArgs $args): void
public function postLoad(PostLoadEventArgs $args): void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public function postLoad(PostLoadEventArgs $args): void
public function postLoad(LifecycleEventArgs|PostLoadEventArgs $args): void

or we can even skip the change in function notation. As we are reducing the scope of what is passed and this function is public, we should still allow for the old notation (until we support Doctrine 2.0)

{
$entity = $args->getObject();

Expand Down