Skip to content

Commit

Permalink
use intval for floor value instead of int casting
Browse files Browse the repository at this point in the history
  • Loading branch information
Roussetos Karafyllakis committed May 9, 2024
1 parent e7bb110 commit 0f9ec08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Utils/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static function humanReadableFileSize(int $bytes, int $decimals = 2): str
}

$size = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
$factor = (int) floor((strlen((string)$bytes) - 1) / 3);
$factor = intval(floor((strlen((string)$bytes) - 1) / 3));

if ($factor === 0 || $decimals < 0) {
$decimals = 0;
Expand Down

0 comments on commit 0f9ec08

Please sign in to comment.