EachOperation   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 15
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 10 1
1
<?php
2
/**
3
 * File was created 06.05.2015 22:18
4
 *
5
 * @author Karsten J. Gerber <[email protected]>
6
 */
7
8
namespace PeekAndPoke\Component\Psi\Operation\Intermediate\Functional;
9
10
use PeekAndPoke\Component\Psi\IntermediateOperation;
11
use PeekAndPoke\Component\Psi\Operation\AbstractBinaryFunctionOperation;
12
use PeekAndPoke\Component\Psi\Solver\IntermediateContext;
13
14
/**
15
 * @author Karsten J. Gerber <[email protected]>
16
 */
17
class EachOperation extends AbstractBinaryFunctionOperation implements IntermediateOperation
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22 3
    public function apply($input, $index, IntermediateContext $context)
23
    {
24 3
        $context->outUseItem     = true;
25 3
        $context->outCanContinue = true;
26
27 3
        $func = $this->function;
28 3
        $func($input, $index);
29
30
        // return the input unmodified
31 3
        return $input;
32
    }
33
}
34