Skip to content

Commit 250c05d

Browse files
committed
Improve token type phpdoc
1 parent 34e6bb2 commit 250c05d

File tree

5 files changed

+7
-0
lines changed

5 files changed

+7
-0
lines changed

src/CliHighlighter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public function highlightToken(int $type, string $value): string
4444
return $prefix . $value . "\x1b[0m";
4545
}
4646

47+
/** @param self::TOKEN_TYPE_* $type */
4748
private function prefix(int $type): string|null
4849
{
4950
if (! isset(self::TOKEN_TYPE_TO_HIGHLIGHT[$type])) {

src/Cursor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public function __construct(
1414
) {
1515
}
1616

17+
/** @param self::TOKEN_TYPE_* $exceptTokenType */
1718
public function next(int|null $exceptTokenType = null): Token|null
1819
{
1920
while ($token = $this->tokens[++$this->position] ?? null) {
@@ -27,6 +28,7 @@ public function next(int|null $exceptTokenType = null): Token|null
2728
return null;
2829
}
2930

31+
/** @param self::TOKEN_TYPE_* $exceptTokenType */
3032
public function previous(int|null $exceptTokenType = null): Token|null
3133
{
3234
while ($token = $this->tokens[--$this->position] ?? null) {

src/Highlighter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ interface Highlighter
3232

3333
/**
3434
* Highlights a token depending on its type.
35+
*
36+
* @param self::TOKEN_TYPE_* $type
3537
*/
3638
public function highlightToken(int $type, string $value): string;
3739

src/HtmlHighlighter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function highlightToken(int $type, string $value): string
5656
return '<span ' . $attributes . '>' . $value . '</span>';
5757
}
5858

59+
/** @param self::TOKEN_TYPE_* $type */
5960
public function attributes(int $type): string|null
6061
{
6162
if (! isset(self::TOKEN_TYPE_TO_HIGHLIGHT[$type])) {

src/Token.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function type(): int
4343
return $this->type;
4444
}
4545

46+
/** @param self::TOKEN_TYPE_* ...$types */
4647
public function isOfType(int ...$types): bool
4748
{
4849
return in_array($this->type, $types, true);

0 commit comments

Comments
 (0)