Skip to content

Commit b508006

Browse files
committed
Document token array format
1 parent f545fc3 commit b508006

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Lexer/Lexer.php

+3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ class Lexer
9292
/** @var string|null */
9393
private $regexp;
9494

95+
/**
96+
* @return list<array{string, int}>
97+
*/
9598
public function tokenize(string $s): array
9699
{
97100
if ($this->regexp === null) {

src/Parser/TokenIterator.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class TokenIterator
1313
{
1414

15-
/** @var mixed[][] */
15+
/** @var list<array{string, int}> */
1616
private $tokens;
1717

1818
/** @var int */
@@ -21,6 +21,9 @@ class TokenIterator
2121
/** @var int[] */
2222
private $savePoints = [];
2323

24+
/**
25+
* @param list<array{string, int}> $tokens
26+
*/
2427
public function __construct(array $tokens, int $index = 0)
2528
{
2629
$this->tokens = $tokens;

0 commit comments

Comments
 (0)