-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Support autowiring for Doctrine\Common\Annotations\Reader #17782
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
Conversation
ping @dunglas |
Looks good to me. @maryo did you tested it? Btw, we need to add some functional tests for this set of rules. |
@dunglas Yes. I tested it manually. I'll see if I can provide some functional tests. |
👍 |
|
||
use Doctrine\Common\Annotations\Reader; | ||
|
||
class AnnotationReader |
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.
Maybe can we create one test class where we will inject all services having an autowiring_type
entry in their definition?
It will ease adding tests for others autowired services.
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 had the same idea, just wasn't sure if having many arguments in the future is not too controversial and I was also wondering about the name of the class (but the current name AnnotationReader
is maybe also not the best choice) :)... So should I do it?
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.
For me it's ok, it's a test class. For the name, what about Foo?
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.
@dunglas I've renamed it to AutowiredServices
. One can add an argument to the constructor for testing another service and test it in the AutowiringTypesTest
. Foo seemed too generic in this case to me. But feel free to rename it or let me know. I was also not sure about the namespace so i kept AutowiringTypes
.
Thank you @maryo. |
…der (maryo) This PR was merged into the 3.1-dev branch. Discussion ---------- Support autowiring for Doctrine\Common\Annotations\Reader | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a I've added support for autowiring based on `Doctrine\Common\Annotations\Reader` interface simmilar to https://github.com/symfony/symfony/pull/17703/files The `annotations.cached_reader` service is injected when cache is enabled. Commits ------- b325f9c Support autowiring for Doctrine\Common\Annotations\Reader
I've added support for autowiring based on
Doctrine\Common\Annotations\Reader
interface simmilar to https://github.com/symfony/symfony/pull/17703/filesThe
annotations.cached_reader
service is injected when cache is enabled.