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

Skip to content

Autoconfig: don't automatically tag decorators #30417

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 4, 2019

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Mar 1, 2019

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

@bendavies
Copy link
Contributor

fixes the linked issue

@fabpot
Copy link
Member

fabpot commented Mar 4, 2019

will be merged in 4.2.

@fabpot fabpot changed the base branch from 4.1 to 4.2 March 4, 2019 08:50
@fabpot fabpot force-pushed the no-tags-decorator-autoconfigure branch from 41f877a to 05ecf82 Compare March 4, 2019 08:50
@fabpot
Copy link
Member

fabpot commented Mar 4, 2019

Thank you @dunglas.

@fabpot fabpot merged commit 05ecf82 into symfony:4.2 Mar 4, 2019
fabpot added a commit that referenced this pull request Mar 4, 2019
This PR was submitted for the 4.1 branch but it was merged into the 4.2 branch instead (closes #30417).

Discussion
----------

Autoconfig: don't automatically tag decorators

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #30391   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

05ecf82 Autoconfig: don't automatically tag decorators
@fabpot fabpot mentioned this pull request Apr 2, 2019
fabpot added a commit that referenced this pull request Feb 4, 2022
…ecorators (LANGERGabrielle)

This PR was merged into the 5.4 branch.

Discussion
----------

[DependencyInjection] Fix AsEventListener not working on decorators

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

When using the `AsEventListener` on a decorator, it is ignored instead of registering the decorator as an event listener. This is because autoconfigured tags are not applied to decorators since #30417.

`EventSubscriberInterface` works as expected since #38999, when the `kernel.event_subscriber'` tag was added to a list of "behavior describing tags" which can be autoconfigured onto decorators.

This PR adds `kernel.event_listener` to this default list of tags, making `AsEventListener` work as expected on decorators.

Commits
-------

5fbb217 Added `kernel.event_listener` to the default list of behavior describing tags, fixing AsEventListener attribute not working on decorators.
nicolas-grekas added a commit that referenced this pull request Jul 7, 2023
…l decorator (HypeMC)

This PR was merged into the 5.4 branch.

Discussion
----------

[DependencyInjection] Don't ignore attributes on the actual decorator

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #49931
| License       | MIT
| Doc PR        | -

An attempt to fix #49931 without reintroducing the problem reported in #30391 and fixed by #30417. The idea here is that if the attribute is declared on the decorator itself, it shouldn't be ignored as it was explicitly added.

Commits
-------

fdd2ec2 [DependencyInjection] Don't ignore attributes on the actual decorator
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.

5 participants