Skip to content

Commit a959fd3

Browse files
committed
Fix newly reported PHPStan errors
1 parent 9b69699 commit a959fd3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/DB_Command.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,12 @@ public function size( $args, $assoc_args ) {
11611161
$size_key = floor( log( (float) $row['Size'] ) / log( 1000 ) );
11621162
$sizes = [ 'B', 'KB', 'MB', 'GB', 'TB' ];
11631163

1164+
if ( is_infinite( $size_key ) ) {
1165+
$size_key = 0;
1166+
}
1167+
1168+
$size_key = (int) $size_key;
1169+
11641170
$size_format = isset( $sizes[ $size_key ] ) ? $sizes[ $size_key ] : $sizes[0];
11651171
}
11661172

0 commit comments

Comments
 (0)