Completed
Push — master ( 8db10c...40b1cc )
by Karsten
01:41
created

TakeUntilPredicate::apply()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 9
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 9
loc 9
ccs 5
cts 5
cp 1
rs 9.6666
c 1
b 0
f 1
cc 1
eloc 5
nc 1
nop 3
crap 1
1
<?php
2
/**
3
 * File was created 06.05.2015 16:25
4
 *
5
 * @author Karsten J. Gerber <[email protected]>
6
 */
7
8
namespace PeekAndPoke\Component\Psi\Operation\Intermediate\Predicate;
9
10
use PeekAndPoke\Component\Psi\Solver\IntermediateContext;
11
12
/**
13
 * @author Karsten J. Gerber <[email protected]>
14
 */
15 View Code Duplication
class TakeUntilPredicate extends AbstractPredicateOperation
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20 5
    public function apply($input, $index, IntermediateContext $context)
21
    {
22 5
        $take = ! $this->test($input, $index);
23
24 5
        $context->outUseItem     = $take;
25 5
        $context->outCanContinue = $take;
26
27 5
        return $input;
28
    }
29
}
30