DispatcherCollection   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 39
ccs 0
cts 17
cp 0
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 3 1
A __construct() 0 3 1
A addDispatcherArray() 0 4 2
A addDispatcher() 0 3 1
1
<?php
2
3
namespace Deployee\Plugins\Deploy\Dispatcher;
4
5
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
43
    {
44
        return $this->dispatcher;
45
    }
46
}