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

Skip to content

[FrameworkBundle][TwigBundle] Make EngineInterface autowirable #18242

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
Mar 25, 2016

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Mar 20, 2016

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

@GuilhemN
Copy link
Contributor

Isn't this option supposed to be defined by the user to choose which service to inject in priority ?
Are there multiple services corresponding to this interfaces ?

@xabbuh
Copy link
Member

xabbuh commented Mar 24, 2016

👍

@GuilhemN
Copy link
Contributor

I answered the question myself 👍

@fabpot
Copy link
Member

fabpot commented Mar 25, 2016

Thank you @dunglas.

@fabpot fabpot merged commit 26ed582 into symfony:master Mar 25, 2016
fabpot added a commit that referenced this pull request Mar 25, 2016
…owirable (dunglas)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[FrameworkBundle][TwigBundle] Make EngineInterface autowirable

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

26ed582 [FrameworkBundle][TwigBundle] Make EngineInterface autowirable
@@ -59,6 +59,9 @@
<argument type="service" id="twig" />
<argument type="service" id="templating.name_parser" />
<argument type="service" id="templating.locator" />

<autowiring-type>Symfony\Component\Templating\EngineInterface</autowiring-type>
<autowiring-type>Symfony\Bundle\FrameworkBundle\Templating\EngineInterface</autowiring-type>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this lead to ambiguous types when loading both engines ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the last defined takes precedence. If both are loaded, twig will be autowired (it it is registered after FrameworkBundle).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if both engines are enabled, the delegating engine should be used, as this is what the templating service will be.

Btw, if you configure only the PHP engine, your PR is also broken as the delegating engine won't be used either for the templating service.

This config should be set in the compiler pass defining what the templating service is

@dunglas dunglas deleted the templating_autowiring branch March 26, 2016 06:58
fabpot added a commit that referenced this pull request Mar 31, 2016
This PR was squashed before being merged into the 3.1-dev branch (closes #18320).

Discussion
----------

[FrameworkBundle] Fix Templating Engine autowiring

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18242 (comment)
| License       | MIT
| Doc PR        | n/a

Commits
-------

c4ccfac [FrameworkBundle] Fix Templating Engine autowiring
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this pull request Mar 31, 2016
This PR was squashed before being merged into the 3.1-dev branch (closes #18320).

Discussion
----------

[FrameworkBundle] Fix Templating Engine autowiring

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/symfony#18242 (comment)
| License       | MIT
| Doc PR        | n/a

Commits
-------

c4ccfac [FrameworkBundle] Fix Templating Engine autowiring
@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.

7 participants