-
Notifications
You must be signed in to change notification settings - Fork 52
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 object oriented hook implementations #194
Comments
Sounds like good idea |
I propose generating single hook classes like following. #[Hook('help')]
final readonly class Help {
/**
* Implements hook_help().
*/
public function __invoke(): void {
}
} |
Nice ... I propose omitting the |
The relevant core issue |
Some static code analysis tools might whine a bit about a function with no doc comment though. |
Drupal >11.1.0 has support for hook implementations in classes with attributes.
https://www.drupal.org/node/3442349
And it seems that many core hooks are moving to this kind of implementation.
Is there any interest in implementing this early to generate code?
The text was updated successfully, but these errors were encountered: