Skip to content

Commit

Permalink
Prevent float to int conversion warning (#151)
Browse files Browse the repository at this point in the history
The $predictedFileSize on line 32 provides a float instead of an integer, in that case we can change the parameter type declaration to float to prevent the Implicit conversion from float to int loses precision warning.
  • Loading branch information
kevinmeijer97 authored Aug 27, 2022
1 parent 6aa7591 commit 805fcbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/WidthCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function calculateWidths(int $fileSize, int $width, int $height): Collect
}
}

protected function finishedCalculating(int $predictedFileSize, int $newWidth): bool
protected function finishedCalculating(float $predictedFileSize, int $newWidth): bool
{
if ($newWidth < 20) {
return true;
Expand Down

0 comments on commit 805fcbe

Please sign in to comment.