Skip to content

Commit 082545b

Browse files
committed
Update for php-8.1 deprecations
1 parent acaa21d commit 082545b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wget.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ protected function progress () {
107107
if ($url == $curl_info['url']) echo str_repeat("\x08", strlen($progress_bar));
108108

109109
$url = $curl_info['url'];
110-
$progress_bar = null;
110+
$progress_bar = '';
111111
if ($curl_info['http_code'] == 200) {
112112
$down_perc = 0;
113113
if ($curl_info['size_download'] <= $curl_info['download_content_length']) $down_perc = (100 * $curl_info['size_download']) / $curl_info['download_content_length'];
114114
$eta = 'N/A';
115115
if ($curl_info['speed_download']) $eta = ($curl_info['download_content_length'] - $curl_info['size_download']) / $curl_info['speed_download'];
116-
$progress_bar = sprintf('[%-30s] %3d%% %02.3fs %02.3fs', str_repeat('#', 30 * $down_perc / 100), $down_perc, $eta, $curl_info['total_time']);
116+
$progress_bar = sprintf('[%-30s] %3d%% %02.3fs %02.3fs', str_repeat('#', (int) (30 * $down_perc / 100)), $down_perc, $eta, $curl_info['total_time']);
117117
}
118118
echo $progress_bar, "\x20\x08";
119119
}

0 commit comments

Comments
 (0)