Skip to content

[DependencyInjection] Fix #16461 Container::set() replace aliases #17742

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
wants to merge 1 commit into from

Conversation

mnapoli
Copy link
Contributor

@mnapoli mnapoli commented Feb 9, 2016

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

Container::set() now overrides any previously alias defined with the same name. Please see #16461 for the background.

Example:

  • given event_dispatcher is an alias to debug.event_dispatcher
  • when I run: $container->set('event_dispatcher', new FakeEventDispatcher)
  • before this patch: nothing happens
  • after this patch: the event_dispatcher is now my fake event dispatcher

…existing aliases

`Container::set()` now overrides any previously alias defined with the same name.
@xabbuh
Copy link
Member

xabbuh commented Feb 9, 2016

👍

Status: Reviewed

@fabpot
Copy link
Member

fabpot commented Feb 12, 2016

Thank you @mnapoli.

@fabpot fabpot closed this Feb 12, 2016
fabpot added a commit that referenced this pull request Feb 12, 2016
…aliases (mnapoli)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #17742).

Discussion
----------

[DependencyInjection] Fix #16461 Container::set() replace aliases

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

`Container::set()` now overrides any previously alias defined with the same name. Please see #16461 for the background.

Example:

- given `event_dispatcher` is an alias to `debug.event_dispatcher`
- when I run: `$container->set('event_dispatcher', new FakeEventDispatcher)`
- *before this patch*: nothing happens
- *after this patch*: the `event_dispatcher` is now my fake event dispatcher

Commits
-------

be85d16 [DependencyInjection] Fix #16461 Let Container::set() replace existing aliases
@mnapoli mnapoli deleted the 16461-set-alias branch February 12, 2016 08:58
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