-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add support for disallowing things when used inside class with certain attribute #180
Comments
(I've misunderstood, #179 is about a different thing, reopening) |
Another example: <?php
final class CreateUserHandler
{
public function __construct(private EventRecorder $recorder)
{
}
#[AsCommandHandler]
public function handle(CreateUserCommand $command)
{
}
} I want to forbid the usage of So in this case, the attribute is put on the |
Hey @ruudk I'm now considering implementing this next(-ish). Would you still find it useful or you don't need it anymore? |
@spaze Sorry for not getting back to you. That's a bit rude of me. Yes, I would totally use this. As a matter of fact, today I needed it again. New use case: I want to disallow RequestStack, but allow it inside a TwigComponent. It's the only way to get the request within a component. #[AsTwigComponent]
final class Table
{
public function __construct(
private RequestStack $requestStack,
) {}
} |
Ok, got it, let me see what I can do :-) |
Example use case, I want to prevent the usage of a certain class / method, inside a class that has
#[Entity]
attribute.The text was updated successfully, but these errors were encountered: