Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Commit 755e047

Browse files
committed
Minor tweaks
1 parent ee4f05f commit 755e047

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Symfony/Installer/DownloadCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ protected function download()
8989
/** @var ProgressBar|null $progressBar */
9090
$progressBar = null;
9191
$downloadCallback = function (ProgressEvent $event) use (&$progressBar) {
92-
$size = $event->downloadSize;
92+
$downloadSize = $event->downloadSize;
9393
$downloaded = $event->downloaded;
9494

95-
if ($size < 1 * 1024 * 1024) {
96-
// display the progress bat only when downloading large files
95+
// progress bar is only displayed for files larger than 1MB
96+
if ($downloadSize < 1 * 1024 * 1024) {
9797
return;
9898
}
9999

@@ -105,9 +105,9 @@ protected function download()
105105
return str_pad($this->formatSize($bar->getStep()), 11, ' ', STR_PAD_LEFT);
106106
});
107107

108-
$progressBar = new ProgressBar($this->output, $size);
108+
$progressBar = new ProgressBar($this->output, $downloadSize);
109109
$progressBar->setFormat('%current%/%max% %bar% %percent:3s%%');
110-
$progressBar->setRedrawFrequency(max(1, floor($size / 1000)));
110+
$progressBar->setRedrawFrequency(max(1, floor($downloadSize / 1000)));
111111
$progressBar->setBarWidth(60);
112112

113113
if (!defined('PHP_WINDOWS_VERSION_BUILD')) {

0 commit comments

Comments
 (0)