Completed
Push — master ( 03d9da...2dac9a )
by Tom
13s
created

InflectorConfig   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
A getIterator() 0 4 1
1
<?php
2
3
namespace TomPHP\ContainerConfigurator;
4
5
use ArrayIterator;
6
use IteratorAggregate;
7
8
final class InflectorConfig implements IteratorAggregate
9
{
10
    /**
11
     * @var array
12
     */
13
    private $inflectors;
14
15
    /**
16
     * @param array $config
17
     */
18
    public function __construct(array $config)
19
    {
20
        $this->inflectors = [];
21
22
        foreach ($config as $interfaceName => $methods) {
23
            $this->inflectors[] = new InflectorDefinition(
24
                $interfaceName,
25
                $methods
26
            );
27
        }
28
    }
29
30
    public function getIterator()
31
    {
32
        return new ArrayIterator($this->inflectors);
33
    }
34
}
35