Completed
Push — 7.5 ( 13f815...467086 )
by André
19:24
created

ParallelProcessList   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addProcess() 0 4 1
A getIterator() 0 4 1
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Publish\API\Repository\Tests\Parallel;
10
11
use Jenner\SimpleFork\Process;
12
13
final class ParallelProcessList implements \IteratorAggregate
14
{
15
    /** @var \Jenner\SimpleFork\Process[] */
16
    private $pool = [];
17
18
    public function addProcess(Process $process): void
19
    {
20
        $this->pool[] = $process;
21
    }
22
23
    public function getIterator(): \Iterator
24
    {
25
        return new \ArrayIterator($this->pool);
26
    }
27
}
28