-
Type: Improvement
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
php_phongo_dispatch_handlers() currently iterates over all registered subscribers and invokes event handlers using zend_call_method(). In the event that an exception is thrown from an event handler, we rely on zend_call_function() to no-op; however, we will continue to loop through the subscribers and make repeated calls to zend_call_method().
If the exception is thrown during a command started handler, php_phongo_dispatch_handlers() will still be called for the subsequent command succeeded/failed event and make additional zend_call_method() calls, which will again no-op.
It would be prudent to check for an exception before calling zend_call_method() in php_phongo_dispatch_handlers() and break out of the subscriber iteration so that we can return early.