Completed
Push — master ( 17fbce...9c0ecb )
by Nikola
02:12
created

ProcessorsRegistry   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 31
ccs 0
cts 19
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A add() 0 4 1
A all() 0 4 1
A getIterator() 0 4 1
1
<?php
2
3
namespace RunOpenCode\ExchangeRate\Registry;
4
5
use RunOpenCode\Backup\Contract\ProcessorInterface;
6
use RunOpenCode\ExchangeRate\Contract\ProcessorsRegistryInterface;
7
8
final class ProcessorsRegistry implements ProcessorsRegistryInterface
9
{
10
    private $processors;
11
12
    public function __construct(array $processors = array())
13
    {
14
        $this->processors = array();
15
16
        foreach ($processors as $processor) {
17
            $this->add($processor);
18
        }
19
    }
20
21
    public function add(ProcessorInterface $processor)
22
    {
23
        $this->processors[] = $processor;
24
    }
25
26
    public function all()
27
    {
28
        return $this->processors;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function getIterator()
35
    {
36
        return new \ArrayIterator($this->processors);
37
    }
38
}
39