Skip to content

Commit

Permalink
Help phpstan understand the available matches
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Sep 8, 2024
1 parent a94c552 commit 59fa2a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Parser/Cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ public function advanceToNextNonSpaceOrNewline(): int

// [0][0] contains the matched text
// [0][1] contains the index of that match
\assert(isset($matches[0]));
$increment = $matches[0][1] + \strlen($matches[0][0]);

$this->advanceBy($increment);
Expand Down
1 change: 1 addition & 0 deletions src/Util/SpecReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static function read(string $data): iterable
$exampleNumber = 0;

foreach ($matches as $match) {
\assert(isset($match[1], $match[2], $match[3]));
if (isset($match[4])) {
$currentSection = $match[4];
continue;
Expand Down

0 comments on commit 59fa2a6

Please sign in to comment.