- Issue created by @larowlan
- 🇮🇹Italy mondrake 🇮🇹
+1 from me on
all new code to just use
EventClass::class
.
This is also consistent with other features in Symfony that tend to reduce boilerplate like e.g. autowiring where with latest practice you now define services with the class or the interface FQCN vs a string.
- 🇳🇱Netherlands bbrala Netherlands
The fact the old approach is deprecated makes me think using event classes is the way to go. The documentation argument might be True for core itself, if we choose to aggregaten events in an event namesoace, but for core modules they still live in the subsystem.
Also. Less files, code and developer rabbitholes to dive into finding stuff. Even though these rabbitholes are pretty shallow.
Perhaps for core events a naming scheme could help.
Anyways my vote would be for using the non deprecated method, :class.
- 🇮🇹Italy mondrake 🇮🇹
BTW - the events recently added to the Database API https://git.drupalcode.org/project/drupal/-/tree/11.x/core/lib/Drupal/Co... are an implementation of the second approach, already in core.