🐞 fix: Error cleanup, add test harness

This commit is contained in:
Keith Solomon committed 2026-03-21 23:21:56 -05:00
1 parent adabacc48d
commit 8e66d69b9e
1743 files changed
+156124 -69

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
<?php declare(strict_types=1);
namespace PhpParser;
/**
* A PHP token. On PHP 8.0 this extends from PhpToken.
*/
class Token extends Internal\TokenPolyfill {
/** Get (exclusive) zero-based end position of the token. */
public function getEndPos(): int {
return $this->pos + \strlen($this->text);
}
/** Get 1-based end line number of the token. */
public function getEndLine(): int {
return $this->line + \substr_count($this->text, "\n");
}
}