Completed
Push — master ( 1b09ea...f7e5d1 )
by Vuong
01:35
created

Pool::flush()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 8
cts 8
cp 1
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * @link https://github.com/vuongxuongminh/yii2-async
4
 * @copyright Copyright (c) 2019 Vuong Xuong Minh
5
 * @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php)
6
 */
7
8
namespace vxm\async;
9
10
use Spatie\Async\Pool as BasePool;
11
12
/**
13
 * Pool control async processes.
14
 *
15
 * @author Vuong Minh <[email protected]>
16
 * @since 1.0.0
17
 */
18
class Pool extends BasePool
19
{
20
21
    /**
22
     * Flush the pool.
23
     */
24 7
    public function flush(): void
25
    {
26 7
        $this->results = [];
27 7
        $this->failed = [];
28 7
        $this->queue = [];
29 7
        $this->finished = [];
30 7
        $this->timeouts = [];
31 7
        $this->inProgress = [];
32 7
    }
33
34
}
35