Skip to content

[Messenger] Exclude AsMessenger attribute from services WIP #60082

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

Conversation

Nayte91
Copy link

@Nayte91 Nayte91 commented Mar 29, 2025

Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
License MIT

As I wanted to auto exclude from services some classes based on their attributes (like messenger messages or doctrine entities), in order to simplify default config/services.yaml->services. App/.exclude configuration, and after some discussions with Sir Grekas, it seems that it can be achieved directly from the components' repositories, and by tagging the given attributes to the container's config.

I'm a bit stuck here, as:

  • My test doesn't pass here as I'm not sure how should I articulate it,
  • I'm not sure my changes will be fired when anyone will use the component,

Any advice or tips would be appreciated to finish this! Sorry for my maybe naive questions

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

This needs to be done in an Extension class, to be effective before the AttributeAutoconfigurationPass.
I think, the it would be fine in the FrameworkExtension, like #59987

@chalasr
Copy link
Member

chalasr commented Mar 29, 2025

Actually AsMessage is excluded already since #59987.
@Nayte91 I suggest to have a look at the implementation to answer your own questions :)

@chalasr chalasr closed this Mar 29, 2025
@Nayte91
Copy link
Author

Nayte91 commented Apr 4, 2025

I just took a look of this PR; Awesome! I learn from what NG coded here. Glad this idea went real, even if it's small ❤️

@Nayte91 Nayte91 deleted the feature/Messenger-exclude-attribute branch April 4, 2025 14:26
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