default $event->sender for class-level events #1472

Closed
mgrechanik opened this Issue Dec 10, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@mgrechanik
Contributor

mgrechanik commented Dec 10, 2013

Hello.

If some event is triggered on an object and there are only class-level handlers for this event the $event->sender property is null.
What about to change this code like this?:

if (is_object($class)) {
    if ($event->sender === null) $event->sender = $class; // add this line
    $class = get_class($class);

@qiangxue qiangxue closed this in fec58f4 Dec 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment