Skip to content

Commit

Permalink
fix namespace separator for class constant resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville authored and icanhazstring committed Mar 7, 2024
1 parent 0b9fd57 commit 460096c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Parser/PHP/Strategy/ClassConstStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public function canHandle(Node $node): bool
*/
public function extractSymbolNames(Node $node): array
{
return [sprintf('%s::%s', $node->class, $node->name)];
return [sprintf('%s\%s', $node->class, $node->name)];
}
}
6 changes: 3 additions & 3 deletions tests/Unit/Parser/PHP/Strategy/ClassConstStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public function getFooBar()
$symbols = $this->parseConsumedSymbols([$this->strategy], $code);

self::assertCount(3, $symbols);
self::assertSame('My\Space\Base::BAR', $symbols[0]);
self::assertSame('static::BAR', $symbols[1]);
self::assertSame('My\Space\Foo::BAR', $symbols[2]);
self::assertSame('My\Space\Base\BAR', $symbols[0]);
self::assertSame('static\BAR', $symbols[1]);
self::assertSame('My\Space\Foo\BAR', $symbols[2]);
}
}

0 comments on commit 460096c

Please sign in to comment.