1: | <?php declare(strict_types=1); |
2: | |
3: | namespace PhpParser; |
4: | |
5: | /** |
6: | * A PHP token. On PHP 8.0 this extends from PhpToken. |
7: | */ |
8: | class Token extends Internal\TokenPolyfill { |
9: | /** Get (exclusive) zero-based end position of the token. */ |
10: | public function getEndPos(): int { |
11: | return $this->pos + \strlen($this->text); |
12: | } |
13: | |
14: | /** Get 1-based end line number of the token. */ |
15: | public function getEndLine(): int { |
16: | return $this->line + \substr_count($this->text, "\n"); |
17: | } |
18: | } |
19: |