-
Notifications
You must be signed in to change notification settings - Fork 9
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
Register listener events using typehints #15
base: master
Are you sure you want to change the base?
Conversation
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.
Could you please add tests to make sure this change works as expected?
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.
Sorry for the delay with review. This looks really interesting.
I've added a few comments.
Also, could you please update the README to include information about this new feature?
--
If you have time, could you please add some tests?
|| $method->isStatic() | ||
|| $method->isAbstract() | ||
|| $method->isVariadic() | ||
|| $method->getNumberOfParameters() !== 1 |
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.
Should we handle methods like __get()
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.
I think I would not know how to do it. I did a tribute (copy + paste + adapt) to the typehint function that uses the tactician-bundle https://github.com/thephpleague/tactician-bundle/blob/bf10a37e27e4306bb9de5d909dba36226aa8e3c4/src/DependencyInjection/HandlerMapping/TypeHintMapping.php
I have corrected some things and added the documentation, of the tests I do not think I can take care of right now I'm sorry |
Hello,
I think it would be interesting to be able to define the event that a listener will execute by means of typehints.
I hope that the code will serve you at least as a test.