@@ -91,10 +91,10 @@ class ProgressHelper extends Helper
91
91
* @var array
92
92
*/
93
93
private $ widths = array (
94
- 'current ' => 4 ,
95
- 'max ' => 4 ,
96
- 'percent ' => 3 ,
97
- 'elapsed ' => 6 ,
94
+ 'current ' => 4 ,
95
+ 'max ' => 4 ,
96
+ 'percent ' => 3 ,
97
+ 'elapsed ' => 6 ,
98
98
);
99
99
100
100
/**
@@ -227,11 +227,12 @@ public function advance($step = 1, $redraw = false)
227
227
throw new \LogicException ('You must start the progress bar before calling advance(). ' );
228
228
}
229
229
230
- if ($ this -> current === 0 ) {
230
+ if (0 === $ this -> current ) {
231
231
$ redraw = true ;
232
232
}
233
+
233
234
$ this ->current += $ step ;
234
- if ($ redraw || $ this ->current % $ this ->redrawFreq === 0 ) {
235
+ if ($ redraw || 0 === $ this ->current % $ this ->redrawFreq ) {
235
236
$ this ->display ();
236
237
}
237
238
}
@@ -256,12 +257,12 @@ public function setCurrent($current, $redraw = false)
256
257
throw new \LogicException ('You can \'t regress the progress bar ' );
257
258
}
258
259
259
- if ($ this -> current === 0 ) {
260
+ if (0 === $ this -> current ) {
260
261
$ redraw = true ;
261
262
}
262
263
263
264
$ this ->current = $ current ;
264
- if ($ redraw || $ this ->current % $ this ->redrawFreq === 0 ) {
265
+ if ($ redraw || 0 === $ this ->current % $ this ->redrawFreq ) {
265
266
$ this ->display ();
266
267
}
267
268
}
@@ -295,7 +296,7 @@ public function finish()
295
296
throw new \LogicException ('You must start the progress bar before calling finish(). ' );
296
297
}
297
298
298
- if ($ this -> startTime !== null ) {
299
+ if (null !== $ this -> startTime ) {
299
300
if (!$ this ->max ) {
300
301
$ this ->barChar = $ this ->barCharOriginal ;
301
302
$ this ->display (true );
@@ -313,7 +314,7 @@ private function initialize()
313
314
{
314
315
$ this ->formatVars = array ();
315
316
foreach ($ this ->defaultFormatVars as $ var ) {
316
- if (strpos ($ this ->format , "% {$ var }% " ) !== false ) {
317
+ if (false !== strpos ($ this ->format , "% {$ var }% " )) {
317
318
$ this ->formatVars [$ var ] = true ;
318
319
}
319
320
}
@@ -344,7 +345,7 @@ private function generate($finish = false)
344
345
345
346
if (isset ($ this ->formatVars ['bar ' ])) {
346
347
$ completeBars = 0 ;
347
- $ emptyBars = 0 ;
348
+ $ emptyBars = 0 ;
348
349
if ($ this ->max > 0 ) {
349
350
$ completeBars = floor ($ percent * $ this ->barWidth );
350
351
} else {
@@ -421,7 +422,7 @@ private function overwrite(OutputInterface $output, $message)
421
422
$ length = $ this ->getLength ($ message );
422
423
423
424
// append whitespace to match the last line's length
424
- if (( $ this ->lastMessagesLength !== null ) && ( $ this ->lastMessagesLength > $ length) ) {
425
+ if (null !== $ this ->lastMessagesLength && $ this ->lastMessagesLength > $ length ) {
425
426
$ message = str_pad ($ message , $ this ->lastMessagesLength , "\x20" , STR_PAD_RIGHT );
426
427
}
427
428
0 commit comments