Skip to content

[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

Merged
merged 1 commit into from
Feb 23, 2023

Conversation

lyrixx
Copy link
Member

@lyrixx 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

@lyrixx lyrixx force-pushed the exclude branch 3 times, most recently from 3a93c5d to 66af40f Compare February 22, 2023 12:04
}

/**
* @dataProvider provideRegisterClassesWithExcludeAttributeTests
Copy link
Member

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]

@derrabus
Copy link
Member

FTR: This feature has been discussed and rejected once: #46655

@alanpoulain
Copy link
Contributor

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');
    }
}

@lyrixx
Copy link
Member Author

lyrixx commented Feb 22, 2023

@derrabus I know but I think many people need it

@alanpoulain because this is a hack 😊

Copy link
Member

@nicolas-grekas nicolas-grekas left a 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 :)

@nicolas-grekas
Copy link
Member

Thank you @lyrixx.

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.

[DependencyInjection] Add attribute #[Exclude]
5 participants