Skip to content

Support for private services as configurator #3758

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

Closed
stof opened this issue Apr 2, 2012 · 0 comments
Closed

Support for private services as configurator #3758

stof opened this issue Apr 2, 2012 · 0 comments

Comments

@stof
Copy link
Member

stof commented Apr 2, 2012

When using a method of a service as configurator, the PhpDumper expects this service to be available through ->get(). This means we cannot use a private service here as the optimization would try to inline it (and even drop it entirely as it does not check configurators).

The easiest fix is probably to change the optimization pass to check configurators and force keeping services, as the XmlLoader does not support inline services for the configurator.

/cc @schmittjoh

@fabpot fabpot closed this as completed in 906f6f6 May 7, 2012
fabpot added a commit that referenced this issue Dec 16, 2013
…urators (realityking)

This PR was merged into the 2.5-dev branch.

Discussion
----------

[DependencyInjection] added support for inlining Configurators

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

This is one commit from #9432.

As mentioned in #3758 configurators can not be private (it's just ignored). This pull changes that and allows them to be inlined. It it also creates better code if a configurator is used multiple times for one service (i.e. to both inject it and configure the same service, or to configure multiple inlined services) but this should be very rare.

Commits
-------

4e9aa07 [DependencyInjection] added support for inlining Configurators
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants