Strict   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
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 24
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 17 3
1
<?php
2
3
  declare(strict_types=1);
4
5
  namespace Funivan\PhpTokenizer\Strategy;
6
7
8
  /**
9
   *
10
   *
11
   */
12
  class Strict extends QueryStrategy {
13
14
    /**
15
     * @inheritdoc
16
     */
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
  }