-
Notifications
You must be signed in to change notification settings - Fork 313
Closed
Description
We get hundreds of New Relic logs every day highlighting three specific lines of code where there's an implicit conversion from float to int.
In ImageResize.php there are many properties that have the potential to be a float or an int, since their type is not explicitly declared.
In the places where a function is expecting an int, the floats should explicitly be converted to integers, since that's what is occurring on implicit conversion anyway.
The functions expecting integers and throwing the warnings:
- imagecopyresampled()
- imagefilledrectangle()
- imagecreatetruecolor()
Log output:
Implicit conversion from float 134.03444889187813 to int loses precision in /var/www/sites/default/vendor/gumlet/php-image-resize/lib/ImageResize.php on line 335
Implicit conversion from float 123.84051948785782 to int loses precision in /var/www/sites/default/vendor/gumlet/php-image-resize/lib/ImageResize.php on line 246
Implicit conversion from float 134.03444889187813 to int loses precision in /var/www/sites/default/vendor/gumlet/php-image-resize/lib/ImageResize.php on line 244
Please help us, we're drowning in warning logs 😅
Metadata
Metadata
Assignees
Labels
No labels