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

Preserve context in non guard events #98

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

gisostallenberg
Copy link

The context was not always preserved in non guard events.

The context was not always preserved in non guard events.
Copy link
Owner

@zerodahero zerodahero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to avoid the awkward type-checking in the base class--it may be that we need to split the inheritance of guard event into something different. The symfony guard event has been slowly moving away from the pathway of the base event, so might be time to split here.

Comment on lines +30 to +32
if (!$this instanceof GuardEvent) {
$result['context'] = $this->getContext();
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than the awkward type-checking here, I think this should be done on the child class instead.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a trait in the base class (HasContextTrait) could you simply check the base class is using that trait and if it is, then attach the context?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants