Just noticed the PSR event manager proposal and took a look at it today. Frankly speaking, I was disappointed at its current achievement, consider it's almost 2 years for this thread. here are the questions I have regarding the PSR event manager proposal.
1. why not use 'detach($event, $callback = null)' to replace 'clearListeners()' ? 2. How to clear all events ? how about 'detach($event = '', $callback = null)' ? 3. $priority higher value means higher priority ? anything about its range ? 4. typo: detach()'s phpdoc @param string $event the event to attach too ? 5. why no sanity checking on event name input ? what if it is not valid, why not throw an expection ? 6. why no 'setParam($name, $value)', what if a handler want to set a single value ? 7. why no default value 'true' for public function stopPropagation($flag) ? HZ 在 2014年7月21日星期一 UTC+8上午4:40:33,Chuck Reeves写道: > > Back at PHPTek, @crell asked if there were any ideas out there for new FIG > standards. I came up with the idea of having an Event Manager Interface > through FIG. > > I took a look at Symfony, Zend Framework 2 and Doctrine to see how they > work then started an early draft. I made mention of it on twitter and > started getting some feedback. I figured I would start a conversation here > to avoid the limitations of twitter and incorporate those ideas into the > draft. Here is the link to what I came up with so far: > https://github.com/manchuck/fig-standards/blob/master/proposed/event-manager.md > > The 1st reaction was with the use of getName. Symfony 3 is moving away > from using it in favor of using objects. My initial thought for including > getName in EventInterface, was to allow implementer to build an event using > EventInterface and then pass that in to the EventManagerInterface::trigger > > I do not know of any other frameworks use an event manager out there. I > would appreciate any feedback on my initial draft as well as insight into > other frameworks out there that use events. > > Thanks > -- You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+unsubscr...@googlegroups.com. To post to this group, send email to php-fig@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/05d1ed4d-6670-4270-b10f-5e17655bb75b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.