ToAll   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A flow() 0 8 2
1
<?php
2
/**
3
 * This file is part of graze/data-flow
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/data-flow/blob/master/LICENSE.md
11
 * @link    https://github.com/graze/data-flow
12
 */
13
14
namespace Graze\DataFlow\Flow\Runner;
15
16
use Graze\DataFile\Helper\OptionalLoggerTrait;
17
use Graze\DataFlow\Flow\FlowCollection;
18
use Graze\DataFlow\Flow\InvokeTrait;
19
use Graze\DataFlow\FlowInterface;
20
use Graze\DataNode\NodeCollection;
21
use Graze\DataNode\NodeInterface;
22
use Psr\Log\LoggerAwareInterface;
23
24
/**
25
 * Runs through a set of flows but providing the initial node to all flows and return th
26
 */
27
class ToAll extends FlowCollection implements FlowInterface, LoggerAwareInterface
28
{
29
    use InvokeTrait;
30
    use OptionalLoggerTrait;
31
32
    /**
33
     * @inheritdoc
34
     */
35 3
    public function flow(NodeInterface $node)
36
    {
37 3
        $collection = new NodeCollection();
38 3
        foreach ($this->items as $flow) {
39 3
            $collection->add($flow->flow($node));
40 3
        }
41 3
        return $collection;
42
    }
43
}
44