Skip to content

Commit

Permalink
Skip inline docblocks like {@see ...}
Browse files Browse the repository at this point in the history
  • Loading branch information
robchett committed Oct 26, 2023
1 parent 07e9ce6 commit 04a0119
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/Psalm/Internal/Type/ParseTreeCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -824,13 +824,31 @@ private function handleValue(array $type_token): void
break;

case '{':

++$this->t;

$nexter_token = $this->t + 1 < $this->type_token_count ? $this->type_tokens[$this->t + 1] : null;

if (strpos($nexter_token[0], '@') !== false) {
$this->t = $this->type_token_count;
if ($type_token[0] === '$this') {
$type_token[0] = 'static';
}

$new_leaf = new Value(
$type_token[0],
$type_token[1],
$type_token[1] + strlen($type_token[0]),
$type_token[2] ?? null,
$new_parent,
);
break;
}

$new_leaf = new KeyedArrayTree(
$type_token[0],
$new_parent,
);
++$this->t;

$nexter_token = $this->t + 1 < $this->type_token_count ? $this->type_tokens[$this->t + 1] : null;

if ($nexter_token !== null && $nexter_token[0] === '}') {
$new_leaf->terminated = true;
Expand Down

0 comments on commit 04a0119

Please sign in to comment.