Closed
Description
Symfony version(s) affected
6.4.9
Description
The property reader symfony/property-info/Util/PhpStanTypeHelper.php doesn't recognized the type of a collection property and try to access an not existing array key at line 169.
return [new Type($subTypes[0]->getBuiltinType(), true, $subTypes[0]->getClassName(), $subTypes[0]->isCollection(), $subTypes[0]->getCollectionKeyTypes(), $subTypes[0]->getCollectionValueTypes())];
How to reproduce
The property with annotation like that can be successful extracted
/** @var ?Permission[] $permissions*/
public ?array $permissions = null;
The following annotation can not be extracted and cause a PHP warning "Undefined array key 0"
/** @var ?Collection<int, Permission> $permissions*/
public ?Collection $permissions = null;
Possible Solution
No response
Additional Context
No response