MapOperation::apply()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 10
cc 1
nc 1
nop 3
crap 1
1
<?php
2
/**
3
 * File was created 06.05.2015 21:00
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 MapOperation extends AbstractBinaryFunctionOperation implements IntermediateOperation
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22 15
    public function apply($input, $index, IntermediateContext $context)
23
    {
24 15
        $context->outUseItem     = true;
25 15
        $context->outCanContinue = true;
26
27 15
        $func = $this->function;
28
29 15
        return $func($input, $index);
30
    }
31
}
32