Skip to content

Commit 37cdf74

Browse files
authored
Merge pull request #68 from 0cool-f/patch-1
fix a deprecation
2 parents ffdc1e9 + ba7c492 commit 37cdf74

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ScanCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ public function normalizeAndTruncatePath($path, $maxLength) {
434434
* @param string $unit Sets default unit. Can have these values: B, KB, MG, GB, TB, PB, EB, ZB and YB
435435
* @return string
436436
*/
437-
public function formatSize($format, $bytes, $unit = null) {
437+
public function formatSize($format, $bytes, $unit = '') {
438438
$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
439439
$bytes = max($bytes, 0);
440440
$unit = strtoupper($unit);
@@ -446,7 +446,7 @@ public function formatSize($format, $bytes, $unit = null) {
446446
else
447447
$multiplier = 1000;
448448

449-
if ($unit === null || !in_array($unit, $units)) {
449+
if ($unit === '' || !in_array($unit, $units)) {
450450
$pow = floor(($bytes ? log($bytes) : 0) / log($multiplier));
451451
$pow = min($pow, count($units) - 1);
452452

@@ -582,4 +582,4 @@ protected function isVerbose()
582582
{
583583
return $this->outputMode !== self::JSON || $this->jsonOutputPath !== '-';
584584
}
585-
}
585+
}

0 commit comments

Comments
 (0)