Kdyby / Events

Events for Nette Framework
https://packagist.org/packages/kdyby/events
Other
58 stars 60 forks source link

Possibly wrong condition in Kdyby\Events\DI\EventsExtension::optimizeListeners() #113

Closed mlutonsky closed 6 years ago

mlutonsky commented 6 years ago

Maybe I just don't understand the meaning of the code, but shouldn't the condition in here: https://github.com/Kdyby/Events/blob/ca3e8d29702c5e0caf6ea86e10f59e73c9cc24b2/src/Events/DI/EventsExtension.php#L386 be without the exclamation mark? Because after update to Kdyby/Events 3.1.1 on our projects (we have custom Presenters, Application etc.) it stopped handle events from these over-written classes. So not I am trying to figure out, whether the behaviour before this update was working just as side-effect/bug or now there is a bug :-)

Thanks!

enumag commented 6 years ago

Indeed this is a bug. It was done by accident during coding style refactoring in this commit. It should be if (!$class) { or if (empty($class)) (. The first might be better because that's what was used before the buggy commit. Send PR please!

enumag commented 6 years ago

Fixed in #114.