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

[StimulusBundle] Normalize Stimulus controller name in event name #2159

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

7-zete-7
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
Issues Fix #2151
License MIT

Adds the ability to use non-normalized Stimulus controller names when describing actions on events from other Stimulus controllers.

Copy link
Member

@smnandre smnandre left a 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 ?

@smnandre smnandre added Status: Needs Work Additional work is needed and removed Status: Needs Review Needs to be reviewed labels Sep 13, 2024
7-zete-7 added a commit to 7-zete-7/ux that referenced this pull request Sep 28, 2024
@carsonbot carsonbot added Status: Needs Review Needs to be reviewed and removed Status: Needs Work Additional work is needed labels Sep 28, 2024
7-zete-7 added a commit to 7-zete-7/ux that referenced this pull request Sep 28, 2024
@7-zete-7 7-zete-7 force-pushed the patch-1 branch 2 times, most recently from b1426f2 to 4db6184 Compare September 28, 2024 08:51
7-zete-7 added a commit to 7-zete-7/ux that referenced this pull request Sep 28, 2024
@7-zete-7
Copy link
Contributor Author

Could you update the CHANGELOG ?

Updated

@7-zete-7
Copy link
Contributor Author

No more unnecessary escaping. Great!

Comment on lines 226 to 231
private function normalizeEventName(?string $eventName): ?string
{
if (null === $eventName) {
return null;
}

Copy link
Member

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.

Suggested change
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.

Copy link
Contributor Author

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.

Copy link
Member

@Kocal Kocal Sep 28, 2024

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 🙏🏻

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

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

Nope

Copy link
Contributor Author

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.

7-zete-7 added a commit to 7-zete-7/ux that referenced this pull request Sep 28, 2024
7-zete-7 added a commit to 7-zete-7/ux that referenced this pull request Sep 28, 2024
@Kocal
Copy link
Member

Kocal commented Sep 29, 2024

Thank you @7-zete-7.

@Kocal Kocal merged commit 1fcf2ea into symfony:2.x Sep 29, 2024
51 of 52 checks passed
@7-zete-7 7-zete-7 deleted the patch-1 branch October 31, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants