diff --git a/src/Utils/WaitGroup/Handlers/RevoltWaitGroup.php b/src/Utils/WaitGroup/Handlers/RevoltWaitGroup.php index 08402be..1cc3a2e 100644 --- a/src/Utils/WaitGroup/Handlers/RevoltWaitGroup.php +++ b/src/Utils/WaitGroup/Handlers/RevoltWaitGroup.php @@ -39,7 +39,7 @@ public function __destruct() /** @inheritdoc */ public function add(int $delta = 1): bool { - $this->_count++; + $this->_count += max($delta, 1); return true; } diff --git a/src/Utils/WaitGroup/Handlers/RippleWaitGroup.php b/src/Utils/WaitGroup/Handlers/RippleWaitGroup.php index abd3083..fb6ba70 100644 --- a/src/Utils/WaitGroup/Handlers/RippleWaitGroup.php +++ b/src/Utils/WaitGroup/Handlers/RippleWaitGroup.php @@ -39,7 +39,7 @@ public function __destruct() /** @inheritdoc */ public function add(int $delta = 1): bool { - $this->_count++; + $this->_count += max($delta, 1); return true; } diff --git a/src/Utils/WaitGroup/Handlers/SwowWaitGroup.php b/src/Utils/WaitGroup/Handlers/SwowWaitGroup.php index 187749d..a82fbf2 100644 --- a/src/Utils/WaitGroup/Handlers/SwowWaitGroup.php +++ b/src/Utils/WaitGroup/Handlers/SwowWaitGroup.php @@ -43,8 +43,8 @@ public function __destruct() /** @inheritdoc */ public function add(int $delta = 1): bool { - $this->_waitGroup->add($delta); - $this->_count++; + $this->_waitGroup->add($delta = max($delta, 1)); + $this->_count += $delta; return true; }