-
-
Notifications
You must be signed in to change notification settings - Fork 554
Closed
Description
Problem/Motivation
The code generated for the EventSubscriber has some errors regarding the Drupal coding standards:
- Expected 1 blank line before function; 2 found before the class constructor.
- Visibility must be declared on method "getSubscribedEvents".
- Doc comment short description must be on a single line, further text should be a separate paragraph on callback functions.
- Missing parameter comment on callback functions.
- Expected type hint "GetResponseEvent"; found "Event" for $event on callback functions.
How to reproduce
Using Drupal Console 1.8 create a custom module:
drupal generate:module \
--module "CS Test" \
--machine-name cs_test \
--module-path modules/custom \
--description "Code Styling test module" \
-q
And then add an EventSubscriber for some events:
drupal generate:event:subscriber \
--module cs_test
Solution
The EventSubscriber class should be modified to follow the Drupal coding standards.