Skip to content

Commit 4fe4ccc

Browse files
committed
[phpstorm-stubs] Normalize array-like type notations in getTypePossibleNamespace function
1 parent 68b2f32 commit 4fe4ccc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/StubsTypeHintsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,8 @@ private static function typeHintsMatchReflection(?PHPParameter $parameter, ?PHPP
634634

635635
private static function getTypePossibleNamespace(string $type): string
636636
{
637+
// Normalize array-like notations (e.g., T[], list<T>, array{...}, array<...>) to 'array' first
638+
$type = self::replaceArrayNotations($type);
637639
$typeParts = explode('\\', $type);
638640
return end($typeParts);
639641
}

0 commit comments

Comments
 (0)