The variable MUST be an integer. Test it and convert it if needed. (#350)
This commit is contained in:
parent
edf87d9cb1
commit
eebdbea1f7
1 changed files with 6 additions and 0 deletions
|
|
@ -179,6 +179,12 @@ abstract class AbstractProgressListener extends EventEmitter implements Listener
|
|||
|
||||
if ($this->lastOutput !== null) {
|
||||
$delta = $currentTime - $this->lastOutput;
|
||||
|
||||
// Check the type of the currentSize variable and convert it to an integer if needed.
|
||||
if(!is_numeric($currentSize)) {
|
||||
$currentSize = (int)$currentSize;
|
||||
}
|
||||
|
||||
$deltaSize = $currentSize - $this->currentSize;
|
||||
$rate = $deltaSize * $delta;
|
||||
if ($rate > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue