Possible   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 23
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 16 3
1
<?php
2
3
  declare(strict_types=1);
4
5
  namespace Funivan\PhpTokenizer\Strategy;
6
7
8
  /**
9
   *
10
   *
11
   */
12
  class Possible extends QueryStrategy {
13
14
    /**
15
     * @inheritdoc
16
     */
17 216
    public function process(\Funivan\PhpTokenizer\Collection $collection, $currentIndex) {
18
19 216
      $result = new StrategyResult();
20 216
      $result->setValid(true);
21
22 216
      $token = $collection->offsetGet($currentIndex);
23
24 216
      if ($token and $this->isValid($token)) {
25 156
        $result->setToken($token);
26 156
        ++$currentIndex;
27
      }
28
29 216
      $result->setNexTokenIndex($currentIndex);
30
31 216
      return $result;
32
    }
33
34
  }