StrategyResult   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 73
ccs 15
cts 15
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getToken() 0 3 1
A isValid() 0 3 1
A setValid() 0 4 1
A setToken() 0 4 1
A setNexTokenIndex() 0 4 1
A getNexTokenIndex() 0 3 1
1
<?php
2
3
  declare(strict_types=1);
4
5
  namespace Funivan\PhpTokenizer\Strategy;
6
7
  use Funivan\PhpTokenizer\Token;
8
9
  /**
10
   *
11
   *
12
   */
13
  class StrategyResult {
14
15
    /**
16
     * @var Token
17
     */
18
    private $token = null;
19
20
21
    /**
22
     * @var int|null
23
     */
24
    private $nexTokenIndex = null;
25
26
    /**
27
     * @var bool
28
     */
29
    private $valid = false;
30
31
32
    /**
33
     * @return Token|null
34
     */
35 333
    public function getToken() {
36 333
      return $this->token;
37
    }
38
39
40
    /**
41
     * @return boolean
42
     */
43 348
    public function isValid() {
44 348
      return ($this->valid === true);
45
    }
46
47
48
    /**
49
     * @param boolean $valid
50
     * @return $this
51
     */
52 348
    public function setValid($valid) {
53 348
      $this->valid = (boolean) $valid;
54 348
      return $this;
55
    }
56
57
58
    /**
59
     * @param Token $token
60
     * @return $this
61
     */
62 321
    public function setToken(Token $token) {
63 321
      $this->token = $token;
64 321
      return $this;
65
    }
66
67
68
    /**
69
     * @param int $nexTokenIndex
70
     * @return $this
71
     */
72 333
    public function setNexTokenIndex($nexTokenIndex) {
73 333
      $this->nexTokenIndex = $nexTokenIndex;
74 333
      return $this;
75
    }
76
77
78
    /**
79
     * @return int|null
80
     */
81 333
    public function getNexTokenIndex() {
82 333
      return $this->nexTokenIndex;
83
    }
84
85
  }