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
BUGFIX: Change return types of some Fusion methods to mixed #2762
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.
Not sure about that, fusion can technically return anything not only strings. I would rather remove the return type if there is no real reason for it.
@albe, @kitsunet, @kdambekalns, you were involved in the small discussion in Slack. What do you think? |
It says string in the docblock, so it should be string. Or the docblock should be changed to say |
I would prefer mixed as Fusion will often return DataStructures |
It really doesn't matter what fusion returns, if fluid says a viewhelper returns strings, then that's that. Although I currently think we have other examples that break that "rule". |
If fluid expects viewHelpers to return strings i agree. This makes fluid pretty much unusable and inextensible to me but hey, i do use pure fusion anyways. |
Looking at fluids code i just found that some helpers like integer (count), mixed (cycle,render,grouped) null(Variable) on renderStatic although the viewHelperInterface says renderStatic should return string. In total i the fluid viewHelperInterface->renderStatic should be typed mixed and the result of the rendere viewHelper here aswell. |
I now changed it to |
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 am fine with that for now! I guess we need to see what fluid does in the future :) THanks a lot
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.
This totally makes sense and reflects how fusion is used. Thanks a lot
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.
What was said above. Fluid ViewHelpers can indeed return something else than string, even though most docblocks suggest otherwise. See e.g. CountViewHelper
which returns an int (yes, simple case).
Merging with previous approvals.
ba8d141 introduced the return type
string
for Fusions RenderViewHelper, so we must always return astring
(notnull
).