-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
TASK: Make single-field Value Objects stringable #5241
Conversation
Implement the magic `__toString()` method to relevant core value objects that represent a single string value. Note: This also adds and configures a PHPStan rule that disallows implicit casting in for those Related: #5239
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.
Looks good to me :)
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.
Looks good so far, but i dont know if we got em all? According to your list at #4156 we forgot ContentDimensionId
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.
Looks good!
I fell like one question is left unanswered. Now with stringcastable things again in fusion do we still need the newly introduced flowqueries? 🤯
because I just updated all our rector migrations 🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦🤦 |
I do kinda like them still because suddenly we could change the API without affecting fusion. |
On the otherhand i think its really valuable to have one way of doing it instead of 2 or multiple ones. There should be always one clear solution so that people dont have to come up with too many guidelines for their own projects. I mean neos was always opinionated so why not this time as well? |
…query operations with neos#5241 value object were made string-able, so they are simply usable in fusion after all. Previously flowquery operations were introduced to not have to do the manual string cast via `.value` in `node.nodeTypeName.value` and similar. The label flowquery operation was introduced in the same run but now we reconsidered that flowquery should mostly be used for traversal and the only real final operation is get(). For this reason we also discourage the property operation now. The negative performance aspect of 8.3 of needlesly resolving all reference nodes by calling `node.properties.title` is dated as now only real properties are ever in the result set.
…query operations with neos/neos-development-collection#5241 value object were made string-able, so they are simply usable in fusion after all. Previously flowquery operations were introduced to not have to do the manual string cast via `.value` in `node.nodeTypeName.value` and similar. The label flowquery operation was introduced in the same run but now we reconsidered that flowquery should mostly be used for traversal and the only real final operation is get(). For this reason we also discourage the property operation now. The negative performance aspect of 8.3 of needlesly resolving all reference nodes by calling `node.properties.title` is dated as now only real properties are ever in the result set.
…query operations with neos/neos-development-collection#5241 value object were made string-able, so they are simply usable in fusion after all. Previously flowquery operations were introduced to not have to do the manual string cast via `.value` in `node.nodeTypeName.value` and similar. The label flowquery operation was introduced in the same run but now we reconsidered that flowquery should mostly be used for traversal and the only real final operation is get(). For this reason we also discourage the property operation now. The negative performance aspect of 8.3 of needlesly resolving all reference nodes by calling `node.properties.title` is dated as now only real properties are ever in the result set.
Implement the magic
__toString()
method in relevant core value objects that represent a single string value.Note: This also adds and configures a PHPStan rule that disallows implicit casting in for those
Related: #5239
Reverts parts of #4156