-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
[StimulusBundle] Normalize Stimulus controller name in event name #2159
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @7-zete-7
Could you update the CHANGELOG ?
Applies suggestion symfony#2159 (comment)
Applies suggestion symfony#2159 (comment)
b1426f2
to
4db6184
Compare
Applies suggestion symfony#2159 (comment)
Updated |
No more unnecessary escaping. Great! |
private function normalizeEventName(?string $eventName): ?string | ||
{ | ||
if (null === $eventName) { | ||
return null; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to not support nullable string here, but only non-nullable string.
private function normalizeEventName(?string $eventName): ?string | |
{ | |
if (null === $eventName) { | |
return null; | |
} | |
private function normalizeEventName(string $eventName): string | |
{ |
The null check should be done before calling this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved null
value check out of the method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move those tests inside src/StimulusBundle/tests/Dto/StimulusAttributesTest.php
file 🙏🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has a change been made since your comment? Cause I dont see the différence now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the test to the common class.
…) method Applies suggestion symfony#2159 (comment)
…malizeEventName() method Resolves suggestion symfony#2159 (comment)
Thank you @7-zete-7. |
Adds the ability to use non-normalized Stimulus controller names when describing actions on events from other Stimulus controllers.