-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Add support for Exclude attribute #49492
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
Conversation
lyrixx
commented
Feb 22, 2023
Q | A |
---|---|
Branch? | 6.3 |
Bug fix? | no |
New feature? | yes |
Deprecations? | no |
Tickets | Fix #46643 |
License | MIT |
Doc PR |
src/Symfony/Component/DependencyInjection/Loader/FileLoader.php
Outdated
Show resolved
Hide resolved
3a93c5d
to
66af40f
Compare
} | ||
|
||
/** | ||
* @dataProvider provideRegisterClassesWithExcludeAttributeTests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's replace the provider with @testWith [true] [false]
FTR: This feature has been discussed and rejected once: #46655 |
Why not just adding the attribute suggested in #47196? #[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION | Attribute::IS_REPEATABLE)]
final class Exclude extends When
{
public function __construct()
{
parent::__construct('never');
}
} |
@derrabus I know but I think many people need it @alanpoulain because this is a hack 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have strong enough arguments to reject a second time so LGTM :)
66af40f
to
cd64c67
Compare
Thank you @lyrixx. |