MtMail
MtMail copied to clipboard
Remove setEventManager from class Composer
Prevent bugs caused by swapping out the eventmanager Fixes issues #41 and #36 Technically this is a breaking change but I think removing setEventManager is fine because:
- the behavior it fixes was introduced by accident at some point (by the ServiceManager?)
- probably nobody calls setEventManager because they would be hit by those bugs and not be able to use the plugins
- I don't see a reason why you'd want to attach the global EventManager, this is also discouraged.
I wrote a test but it was rather circular. You'd need a pretty big end-to-end test of the real ServiceManager + real Composer + a mocked plugin to test this case.
@mtymek Can you consider this change?
@mtymek If you have some time, that would be awesome. I'm having the exact same issue at the moment.