Conditions | 3 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
17 | 321 | public function process(\Funivan\PhpTokenizer\Collection $collection, $currentIndex) { |
|
18 | |||
19 | 321 | $result = new StrategyResult(); |
|
20 | 321 | $result->setValid(true); |
|
21 | |||
22 | 321 | $token = $collection->offsetGet($currentIndex); |
|
23 | |||
24 | 321 | if ($token === null or $this->isValid($token) === false) { |
|
25 | 312 | $result->setValid(false); |
|
26 | 312 | return $result; |
|
27 | } |
||
28 | |||
29 | 303 | $result->setNexTokenIndex(++$currentIndex); |
|
30 | 303 | $result->setToken($token); |
|
31 | |||
32 | 303 | return $result; |
|
33 | } |
||
34 | |||
35 | } |