-
Notifications
You must be signed in to change notification settings - Fork 148
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] Create default Size
with correct types in expandBackgroundShorthand
#814
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.
We need some unit tests here to help us mere mortals understand what is happening, and what is supposed to be happening.
Once we've established what's going on, and how the original code worked (or didn't), the changelog entry can be more descriptive.
36cfa29
to
0ada1ca
Compare
I agree that we should cover bug fixes (including fixes to issues found by PHPStan) with unit tests (i.e., regression tests). In this particular case, I'd prefer not to spend time on writing tests as the offending code is part of a deprecated method that we're planning to remove in #511. Would you be okay with not having regression tests in this case? This code would break once we add native types to constructors (see #818). I'm not quite happy with the commit and changelog messages either and would appreciate some help. This is the called constructor: function __construct($fSize, $sUnit = null, $bIsColorComponent = false, $iLineNo = 0); When constructing the
So in effect (as long as we don't have native type for the What could be a more fitting commit and change logmessage for this? |
I hadn't relized this was in a deprecated method.
Yes, in this case.
I think the line number being passed is not correct anyway, since it's that of the declaration block rather than the rule. Also, these are the default values for when background position is not specified, so perhaps it's right that no line number is set. Thus it might be best to simply remove all the null/zero/false arguments (i.e. just have
Perhaps "Create default |
Size
constructorSize
with correct types in expandBackgroundShorthand
0ada1ca
to
2a0fd11
Compare
Thanks! I've updated the commit message and PR title accordingly and removed the changelog entry. (For the backport PR, I think the changelog entry would still be helpful.) |
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 used the visual merge to resolve the conflict in phpstan-baseline.neon
, which seems to have worked out OK.
Thus it might be best to simply remove all the null/zero/false arguments (i.e. just have
new Size(0, '%')
), so that the behaviour is effectively unchanged
I note you didn't adopt that suggestion, but as this is a deprecated method, it doesn't really matter.
(For the backport PR, I think the changelog entry would still be helpful.)
If we do a backport. But even then, the method is already deprecated in the 8.x branch.
This is the v8.x backport of #814.
No description provided.