| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 16 |
| Ratio | 100 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 2 | public function apply($input, $index, IntermediateContext $context) |
|
| 37 | { |
||
| 38 | 2 | if (! $context->memory->contains($this)) { |
|
| 39 | 2 | $context->memory->offsetSet($this, 0); |
|
| 40 | } |
||
| 41 | |||
| 42 | 2 | $count = $context->memory->offsetGet($this); |
|
| 43 | 2 | $context->memory->offsetSet($this, $count+1); |
|
| 44 | |||
| 45 | 2 | $takeIt = $count < $this->limit; |
|
| 46 | |||
| 47 | 2 | $context->outUseItem = $takeIt; |
|
| 48 | 2 | $context->outCanContinue = $takeIt; |
|
| 49 | |||
| 50 | 2 | return $input; |
|
| 51 | } |
||
| 52 | } |
||
| 53 |