NodeFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 10 2
1
<?php
2
3
namespace Assimtech\Tempo\Factory;
4
5
use Assimtech\Tempo\Node;
6
7
/**
8
 * Constructs Nodes from configuration
9
 */
10
class NodeFactory
11
{
12
    /**
13
     * @param array $config
14
     * @return \Assimtech\Tempo\Node\NodeInterface[]
15
     */
16 1
    public function create(array $config)
17
    {
18 1
        $nodes = array();
19
20 1
        foreach ($config as $nodeName => $nodeConfig) {
21 1
            $nodes[$nodeName] = new Node\Remote($nodeConfig);
22 1
        }
23
24 1
        return $nodes;
25
    }
26
}
27