File tree 1 file changed +5
-6
lines changed
src/Symfony/Component/Console/Helper
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,7 @@ final class ProgressBar
46
46
private $ messages = [];
47
47
private $ overwrite = true ;
48
48
private $ terminal ;
49
- private $ firstRun = true ;
50
- private $ currentMessage = '' ;
49
+ private $ previousMessage ;
51
50
52
51
private static $ formatters ;
53
52
private static $ formats ;
@@ -433,14 +432,14 @@ private function setRealFormat(string $format)
433
432
*/
434
433
private function overwrite (string $ message ): void
435
434
{
436
- if ($ this ->currentMessage === $ message ) {
435
+ if ($ this ->previousMessage === $ message ) {
437
436
return ;
438
437
}
439
438
440
- $ this -> currentMessage = $ message ;
439
+ $ originalMessage = $ message ;
441
440
442
441
if ($ this ->overwrite ) {
443
- if (! $ this ->firstRun ) {
442
+ if (null !== $ this ->previousMessage ) {
444
443
if ($ this ->output instanceof ConsoleSectionOutput) {
445
444
$ lines = floor (Helper::strlen ($ message ) / $ this ->terminal ->getWidth ()) + $ this ->formatLineCount + 1 ;
446
445
$ this ->output ->clear ($ lines );
@@ -458,7 +457,7 @@ private function overwrite(string $message): void
458
457
$ message = PHP_EOL .$ message ;
459
458
}
460
459
461
- $ this ->firstRun = false ;
460
+ $ this ->previousMessage = $ originalMessage ;
462
461
$ this ->lastWriteTime = microtime (true );
463
462
464
463
$ this ->output ->write ($ message );
You can’t perform that action at this time.
0 commit comments