Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

mgrechanik opened this issue Dec 10, 2013 · 0 comments

Comments

@mgrechanik
Copy link
Contributor

@mgrechanik 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.