by Petr Škoda.
Hmm, there would be a need for $event->soon_to_be_triggered() and $event->event_was_triggered() and also you would need some internal properties to verify the methods are called in correct order and only from the event dispatcher. The event might be also "unserialised" from the log storage which need to block any triggering.
The $event->trigger() needs a lot less lines of code, the public API is much smaller and it would be less error-prone. I really do not see any benefit in trigger($event), there seem to be only more problems there.
Why all legacy support only in base class?
1/ I think it is better to have all legacy code in one class only instead of multiple parts with necessary public APIs
2/ we can make the api protected, invisible outside of events, that means we can remove it in future completely without breaking public API
3/ it may be faster
The $event->trigger() needs a lot less lines of code, the public API is much smaller and it would be less error-prone. I really do not see any benefit in trigger($event), there seem to be only more problems there.
Why all legacy support only in base class?
1/ I think it is better to have all legacy code in one class only instead of multiple parts with necessary public APIs
2/ we can make the api protected, invisible outside of events, that means we can remove it in future completely without breaking public API
3/ it may be faster