Total Complexity | 5 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | class DispatcherCollection |
||
7 | { |
||
8 | /** |
||
9 | * @var array |
||
10 | */ |
||
11 | private $dispatcher; |
||
12 | |||
13 | /** |
||
14 | * DispatcherCollection constructor. |
||
15 | */ |
||
16 | public function __construct() |
||
17 | { |
||
18 | $this->dispatcher = []; |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * @param TaskDefinitionDispatcherInterface[] $collection |
||
23 | */ |
||
24 | public function addDispatcherArray(array $collection) |
||
25 | { |
||
26 | foreach($collection as $dispatcher){ |
||
27 | $this->addDispatcher($dispatcher); |
||
28 | } |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param TaskDefinitionDispatcherInterface $dispatcher |
||
33 | */ |
||
34 | public function addDispatcher(TaskDefinitionDispatcherInterface $dispatcher) |
||
35 | { |
||
36 | $this->dispatcher[] = $dispatcher; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @return TaskDefinitionDispatcherInterface[] |
||
41 | */ |
||
42 | public function toArray(): array |
||
45 | } |
||
46 | } |