-
-
Notifications
You must be signed in to change notification settings - Fork 64
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 Metadata Caching when it changes in EventListeners #42
base: 1.1.x
Are you sure you want to change the base?
Fix Metadata Caching when it changes in EventListeners #42
Conversation
2e1a160
to
af490ed
Compare
…data-caching-1-1-x
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.
Solution looks valid, but we need to duplicate entries in aliasesMap
to simplify "happy path" lookups, and reduce overhead there.
|
||
if ($pos === false) { | ||
return $class; | ||
switch (true) { |
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 don't use switch(true)
. Two if
blocks are a better solution here.
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.
Done.
lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php
Outdated
Show resolved
Hide resolved
*/ | ||
private function getRealClass(string $class) : string | ||
protected function getRealClassName(string $className) : string |
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.
This should most likely stay private
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.
This is protected as per suggestion of @alcaeus at #21 (comment)
{ | ||
$pos = strrpos($class, '\\' . Proxy::MARKER . '\\'); | ||
if (isset($this->aliasesMap[$className])) { |
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.
Considering that duplicate entries are allowed, is this property still needed?
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.
This was done because of #21 (comment) Can you please decipher comment chain and explain if something still needs to be done?
I've closed PR #21 and created new one, because that PR is targeted on master.
This PR fixed 2 bugs: