/**
* @implements \IteratorAggregate<int, array{
* routeName: string,
* optional?: true,
* }>
*/
class Example implements \IteratorAggregate
{
/**
* @param list<array{
* routeName: string,
* optional?: true,
* }> $elements
*/
public function __construct(
private array $elements,
) {
}
public function getIterator(): \Traversable
{
return new \ArrayIterator($this->elements);
}
}
Bug report
It seems that the
optionalkey somehow becomesboolinstead oftrue:Code snippet that reproduces the problem
https://phpstan.org/r/16c5ac66-1810-424e-a068-38bbccfaa914
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
No response