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

Skip to content

[FrameworkBundle][TwigBundle] Make EngineInterface autowirable#18242

Merged
fabpot merged 1 commit into
symfony:masterfrom
dunglas:templating_autowiring
Mar 25, 2016
Merged

[FrameworkBundle][TwigBundle] Make EngineInterface autowirable#18242
fabpot merged 1 commit into
symfony:masterfrom
dunglas:templating_autowiring

Conversation

@dunglas
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

xabbuh commented Mar 24, 2016

👍

@GuilhemN
Copy link
Copy Markdown
Contributor

I answered the question myself 👍

@fabpot
Copy link
Copy Markdown
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
<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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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