Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37677

Re: Feedback requested on new Events system specification

$
0
0
by Hubert Chathi.  

re: control, you could have something like $event->setTriggered() (terrible name, can't think of anything better) that does validation and sets the triggered flag (and throws an error if the triggered flag is already set).  So essentially, $event->setTriggered() would be the first few lines of the proposed $event->trigger().  Then the event manager would call $event->setTriggered() before actually triggering the event.

Splitting $event->trigger() up like this would allow for more unit testing.  For example, the current proposal can't test validation without triggering the event.  You also can't test that the event is unchangeable after the trigger flag is set, without triggering the event.  Allowing for other event managers will also allow for testing event handlers individually, without calling the other event handlers.

re: logging/legacy events, why is that part of the event class and not the event manager?


Viewing all articles
Browse latest Browse all 37677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>