I think it is misleading to the user to encourage the use of class constants as 
event names. An event name is a simple string in a global namespace while a 
class constant includes a namespace and class name. I am concerned that users 
will create disparate class constants with the same value, leading to a 
collision. For example, if Foo\Bar::preExecute and Bar\Foo::preExecute are both 
equal to 'preExecute' they will both trigger the same listeners when 
dispatched, which will probably lead to unexpected results and some unnecessary 
WTFs.

The best solution I can think of is to stop using class constants and just use 
simple strings instead. This will make it clear to the user that they are 
dealing with a simple string in a global namespace.

$dispatcher->dispatch('preSomethingExecute')

What do you think?
Kris

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to