Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 878b6ce

Browse files
committed
[PropertyInfo] Add failing test case for multi phpdoc covered promoted properties
This demonstrates that #46056 causes a regression and incorrectly detects types in case there are multiple phpdoc covered promoted properties.
1 parent 3c4bc1d commit 878b6ce

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpStanExtractorTestDoc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ public function php80TypesProvider()
467467
return [
468468
[Php80Dummy::class, 'promotedAndMutated', [new Type(Type::BUILTIN_TYPE_STRING)]],
469469
[Php80Dummy::class, 'promoted', null],
470+
[Php80Dummy::class, 'collection', [new Type(Type::BUILTIN_TYPE_ARRAY, collection: true, collectionValueType: new Type(Type::BUILTIN_TYPE_STRING))]],
470471
[Php80PromotedDummy::class, 'promoted', null],
471472
];
472473
}

src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php80Dummy.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ class Php80Dummy
1717

1818
/**
1919
* @param string $promotedAndMutated
20+
* @param array<string> $collection
2021
*/
21-
public function __construct(private mixed $promoted, private mixed $promotedAndMutated)
22+
public function __construct(private mixed $promoted, private mixed $promotedAndMutated, private array $collection)
2223
{
2324
}
2425

0 commit comments

Comments
 (0)