NodeFactory::create()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
crap 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