@@ -146,13 +146,11 @@ discard block |
||
| 146 | 146 | $this->processes[] = $process; |
| 147 | 147 | end($this->processes); |
| 148 | 148 | $this->waitingQueue[] = key($this->processes); |
| 149 | - } |
|
| 150 | - else { |
|
| 149 | + } else { |
|
| 151 | 150 | if ( !isset($this->processes[$key]) ) { |
| 152 | 151 | $this->processes[$key] = $process; |
| 153 | 152 | $this->waitingQueue[] = $key; |
| 154 | - } |
|
| 155 | - else { |
|
| 153 | + } else { |
|
| 156 | 154 | throw new \InvalidArgumentException('The "' . $key . '" key is already in use.'); |
| 157 | 155 | } |
| 158 | 156 | } |
@@ -261,8 +259,7 @@ discard block |
||
| 261 | 259 | |
| 262 | 260 | continue; |
| 263 | 261 | } |
| 264 | - } |
|
| 265 | - catch ( \Exception $exception ) { |
|
| 262 | + } catch ( \Exception $exception ) { |
|
| 266 | 263 | $this->setProcessException($process_key, $exception); |
| 267 | 264 | $executed_index = $index; |
| 268 | 265 | break; |
@@ -372,8 +369,7 @@ discard block |
||
| 372 | 369 | |
| 373 | 370 | if ( $this->limit ) { |
| 374 | 371 | $this->runningQueue = array_slice($this->waitingQueue, 0, $this->limit, true); |
| 375 | - } |
|
| 376 | - else { |
|
| 372 | + } else { |
|
| 377 | 373 | $this->runningQueue = $this->waitingQueue; |
| 378 | 374 | } |
| 379 | 375 | |