Preserve context in non guard events#98
Open
gisostallenberg wants to merge 1 commit intozerodahero:developfrom
Open
Preserve context in non guard events#98gisostallenberg wants to merge 1 commit intozerodahero:developfrom
gisostallenberg wants to merge 1 commit intozerodahero:developfrom
Conversation
The context was not always preserved in non guard events.
zerodahero
requested changes
Dec 18, 2024
Owner
zerodahero
left a comment
There was a problem hiding this comment.
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(); | ||
| } |
Owner
There was a problem hiding this comment.
Rather than the awkward type-checking here, I think this should be done on the child class instead.
There was a problem hiding this comment.
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?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The context was not always preserved in non guard events.