Skip to content

Fix type of serialization groups#359

Merged
lchrusciel merged 1 commit into
Sylius:masterfrom
loic425:fix/serization-groups-type
Jan 21, 2022
Merged

Fix type of serialization groups#359
lchrusciel merged 1 commit into
Sylius:masterfrom
loic425:fix/serization-groups-type

Conversation

@loic425

@loic425 loic425 commented Jan 20, 2022

Copy link
Copy Markdown
Member
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations?
Related tickets
License MIT

@loic425 loic425 requested a review from a team as a code owner January 20, 2022 15:16

@lchrusciel lchrusciel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we write super simple case for that to avoid issues in the future?

@loic425

loic425 commented Jan 20, 2022

Copy link
Copy Markdown
Member Author

Can we write super simple case for that to avoid issues in the future?

There's already a simple test.... But I don't even know how it keeps working with the wrong type.
https://github.com/Sylius/SyliusResourceBundle/blob/master/src/Bundle/Tests/Routing/RoutesAttributesLoaderTest.php#L147

@lchrusciel

Copy link
Copy Markdown
Contributor

thats the worst type of bugs - you know, that tests should fail, but they are green :(

@loic425

loic425 commented Jan 20, 2022

Copy link
Copy Markdown
Member Author

thats the worst type of bugs - you know, that tests should fail, but they are green :(

Yes but the result is ok, even with the wrong type, I also test it manually 🗡️

@loic425

loic425 commented Jan 20, 2022

Copy link
Copy Markdown
Member Author

@lchrusciel I think there is some "magic" somewhere :)

@vvasiloi

vvasiloi commented Jan 20, 2022

Copy link
Copy Markdown
Contributor

It works... must be a bug (or feature) of PHP: https://3v4l.org/fOejp#v8.0.15

Screenshot

image

@vvasiloi

Copy link
Copy Markdown
Contributor

And although I only defined the serializationGroups in the attribute class, I also passed (unintentionally, copy/paste) name, path and controller and all were returned as a result.

@lchrusciel lchrusciel added the Bug Confirmed bugs or bugfixes. label Jan 21, 2022
@lchrusciel lchrusciel merged commit 90c4f95 into Sylius:master Jan 21, 2022
@lchrusciel

Copy link
Copy Markdown
Contributor

Thanks, Loïc! 🥇

@loic425 loic425 deleted the fix/serization-groups-type branch January 21, 2022 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Confirmed bugs or bugfixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants