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

Use the Persistence Proxy interface for checking ORM proxy objects #2715

Merged
merged 1 commit into from
Nov 25, 2023

Conversation

mbabker
Copy link
Contributor

@mbabker mbabker commented Oct 29, 2023

Ref: #2708

In ORM 2.14, Doctrine\ORM\Proxy\Proxy was deprecated and the upgrade guide suggests using Doctrine\Persistence\Proxy instead, with the ORM interface removed in 3.0. This updates all checks to reflect this deprecation.

@codecov
Copy link

codecov bot commented Oct 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (058e95a) 79.36% compared to head (568dd64) 79.36%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2715   +/-   ##
=======================================
  Coverage   79.36%   79.36%           
=======================================
  Files         162      162           
  Lines        8457     8457           
=======================================
  Hits         6712     6712           
  Misses       1745     1745           
Files Coverage Δ
src/References/Mapping/Event/Adapter/ODM.php 55.17% <100.00%> (ø)
src/References/Mapping/Event/Adapter/ORM.php 60.00% <100.00%> (ø)
src/Tool/Wrapper/EntityWrapper.php 100.00% <ø> (ø)
...rc/Tree/Entity/Repository/NestedTreeRepository.php 89.86% <ø> (ø)
src/Tree/Strategy/ORM/Nested.php 94.91% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@franmomu franmomu requested a review from phansys October 30, 2023 22:11
@@ -32,7 +32,7 @@ public function getIdentifier($om, $object, $single = true)
}

if ($om instanceof EntityManagerInterface) {
if ($object instanceof ORMProxy) {
if ($object instanceof PersistenceProxy) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm wondering if relaxing this check deserves an entry in the changelog, since previous to this change only instances of Doctrine\ORM\Proxy\Proxy were admitted in this condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd say this is more of an internal change to match the upstream API changes and not a deliberate feature change in this package. So not necessarily something that needs to be called out in a changelog entry.

@franmomu franmomu merged commit daa263a into doctrine-extensions:main Nov 25, 2023
19 checks passed
@franmomu
Copy link
Collaborator

thanks @mbabker!

@mbabker mbabker deleted the orm-3-compat-proxy branch November 25, 2023 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants