-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix matching lazy collections with enums criteria #11516
base: 3.2.x
Are you sure you want to change the base?
Conversation
d38e933
to
f9dbfdf
Compare
Please find a meaningful title for your PR. We use the titles in our automatically composed change log. |
Hello @derrabus |
Up @derrabus . This PR is still stuck because of your ghost request change 😢 |
Hi, I've got these issues from Psalm:
And I don't understand what it means... I don't know how to fix those "issues". Thanks for your help. |
Your changes seem to have removed code with psalm issues that is still ignored in the psalm baseline and don't need to be anymore. If you find the affected lines in the XML for |
5e312cc
to
adf4a53
Compare
Hi @derrabus I don't know why, but the merging is blocked because of a change you requested on one of the commits of this branch. Thanks a lot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, good catch and work on this!
A few suggestions, then its ready to merge from my POV.
$paramTypes[] = PersisterHelper::getTypeOfField($name, $targetClass, $this->em)[0]; | ||
} | ||
} | ||
|
||
$params = array_merge($params, ...$paramsValues); | ||
unset($paramsValues); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this unset
, its not needed.
$this->_em->flush(); | ||
$libraryId = $library->id; | ||
|
||
unset($library, $redBook, $blueBook); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this unset, its not needed.
$this->_em->flush(); | ||
$libraryId = $library->id; | ||
|
||
unset($library, $redBook, $blueBook); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this unset, its not needed.
$thrillerCategoryId = $thrillerCategory->id; | ||
|
||
$this->_em->clear(); | ||
unset($thrillerCategory, $fantasyCategory, $blueBook, $redBook); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this unset, its not needed.
$thrillerCategoryId = $thrillerCategory->id; | ||
|
||
$this->_em->clear(); | ||
unset($thrillerCategory, $fantasyCategory, $blueBook, $redBook); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this unset, its not needed.
|
||
public function getBooksWithColor(BookColor $bookColor): Collection | ||
{ | ||
$criteria = Criteria::create() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if you move this code into the test, because reading the test code now its not easy to grasp how test name matches to code. Same for the other Criteria code in Library.
Fix issue #11481
I identified some duplicated code between the
BasicEntityPersister
and theManyToManyPersister
, like the methodexpandCriteriaParameters
.Because I don't want to create side effects, I just factorized two methods :
getValues
andgetIndividualValue
into a trait.Thanks for your review !