-
Notifications
You must be signed in to change notification settings - Fork 299
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
Refactoring/listener #21
Conversation
* @param string $traitName | ||
* @param boolean $isRecursive | ||
*/ | ||
protected function isEntityUseTrait(\ReflectionClass $class, $traitName, $isRecursive = false) |
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.
isEntityUsingTrait
makes more sense, doesn't it?
Anyway, isn't the goal of this PR to abstract wether this listener applies on Document or Entity?
In this case, this method could be called isObjectUsingTrait
Last thing, as I believe these 3 methods will be usefull in many other places, you might want to move it to its own class and inject it in the listener (something like Knp\DoctrineBehaviors\Reflection\ClassAnalyzer
)
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.
Hmmmm ok....
About the method name, the goal of DoctrineBehaviors is to add features to Doctrine Entities. Is that a real problem if methods names talk about entities.
The class Analyser is a good idea.
Which is the status of this PR? I'm interested on having this on master as it seems to support Trait hierarchies, is it correct? Thank you! |
it's ok to merge. we should just use it with "odm" branch. |
Just into the odm branch? It's that the main dev branch or something? |
Add an abstract listener and refactor all listeners