Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 1 commit into from
Feb 26, 2016
Merged

Support autowiring for Doctrine\Common\Annotations\Reader #17782

merged 1 commit into from
Feb 26, 2016

Conversation

maryo
Copy link
Contributor

@maryo maryo commented Feb 12, 2016

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.

@fabpot
Copy link
Member

fabpot commented Feb 14, 2016

ping @dunglas

@dunglas
Copy link
Member

dunglas commented Feb 14, 2016

Looks good to me. @maryo did you tested it? Btw, we need to add some functional tests for this set of rules.

@maryo
Copy link
Contributor Author

maryo commented Feb 15, 2016

@dunglas Yes. I tested it manually. I'll see if I can provide some functional tests.

@maryo maryo closed this Feb 21, 2016
@maryo maryo reopened this Feb 21, 2016
@dunglas
Copy link
Member

dunglas commented Feb 21, 2016

👍


use Doctrine\Common\Annotations\Reader;

class AnnotationReader
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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?

Copy link
Contributor Author

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.

@fabpot
Copy link
Member

fabpot commented Feb 26, 2016

Thank you @maryo.

@fabpot fabpot merged commit b325f9c into symfony:master Feb 26, 2016
fabpot added a commit that referenced this pull request Feb 26, 2016
…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
@fabpot fabpot mentioned this pull request May 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants