-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
fix: Set font size to 10 when given 0 #2100
Conversation
Thank you for the contribution; although any fix to the values passed to the method should include other invalid values as well |
Thank you for the review. I expanded the test and added the handling of all other invalid values. |
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.
Thanks for making those changes to full validate the value, and for ensuring that it's covered by unit tests...
When we first wrote those basic setters, we never really expected any developer to pass through invalid values, so the validation checks were minimal.... over the years, we've been proven wrong time and again, but never really got round to improving the validation checks, as there were always more important demands for more serious bugs or new features
@@ -255,9 +255,16 @@ public function getSize() | |||
*/ | |||
public function setSize($pValue) |
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.
The docblock needs modifying to mixed
to keep phpstan happy, and it looks like phpcs is complaining about trailing white space in the comment lines.
If you can just make those changes, then the PR is good to merge
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.
The docblock needs modifying to mixed to keep phpstan happy, and it looks like phpcs is complaining about trailing white space in the comment lines.
If you can just make those changes, then the PR is good to merge
This change restored behavior from PHP7 in PHP8. In PHP7 calling setSize(0) resulted in font size being set to 10. The fix addresses change to equal comparisons in PHP8. Extra comparison is added to keep result from PHP7 in PHP8 for the setSize(0) case.
Thank you. Updated the docblock, ran |
This is:
Checklist:
Why this change is needed?
This change restored behavior from PHP7 in PHP8. In PHP7 calling
setSize(0) resulted in font size being set to 10. The fix addresses
change to equal comparisons in PHP8. Extra comparison is added to keep
result from PHP7 in PHP8 for the setSize(0) case.