| Total Complexity | 10 |
| Total Lines | 91 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | abstract class AbstractToken |
||
| 20 | { |
||
| 21 | |||
| 22 | public $line = 0; |
||
| 23 | public $type = ''; |
||
| 24 | public $name = ''; |
||
| 25 | public $value = ''; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * |
||
| 29 | * @var TokenInterface[] |
||
| 30 | */ |
||
| 31 | protected $tokens = []; |
||
| 32 | protected $index = 0; |
||
| 33 | |||
| 34 | //abstract public function __construct(&$data, &$tokens, $index); |
||
| 35 | |||
| 36 | /** |
||
| 37 | * |
||
| 38 | * @param int $type |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | public function is($type) |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * |
||
| 48 | * @param int $type |
||
| 49 | * @return bool |
||
| 50 | */ |
||
| 51 | public function not($type) |
||
| 52 | { |
||
| 53 | return $this->type !== $type; |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Check token value |
||
| 58 | * @param string $value |
||
| 59 | */ |
||
| 60 | public function valIs($value) |
||
| 61 | { |
||
| 62 | return $this->value === $value; |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Get token value |
||
| 67 | * @param string $value |
||
| 68 | */ |
||
| 69 | public function val() |
||
| 70 | { |
||
| 71 | return $this->value; |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Get previous token, ignoring whitespace |
||
| 76 | * @return TokenInterface |
||
| 77 | */ |
||
| 78 | public function prev() |
||
| 91 | } |
||
| 92 | |||
| 93 | /** |
||
| 94 | * Get next token, ignoring whitespace |
||
| 95 | * @return TokenInterface |
||
| 96 | */ |
||
| 97 | public function next() |
||
| 110 | } |
||
| 111 | |||
| 112 | } |
||
| 113 |