Bug report
ConstantArrayType::tryRemove treats HasOffsetValueType the same way it handle HasOffsetType by unsetting the value but shouldn't.
For HasOffsetValueType
- If valueType isSuperTypeOf yes, it behaves the same
- If valueType isSuperTypeOf no, it has no impact
- If valueType isSuperTypeOf maybe it should reduce the value type and make the key optional
Code snippet that reproduces the problem
No response
Expected output
For instance array{a: string|int} tryRemove HasOffsetValueType('a', int) should gives array{a?: string}
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
ConstantArrayType::tryRemove treats HasOffsetValueType the same way it handle HasOffsetType by unsetting the value but shouldn't.
For HasOffsetValueType
Code snippet that reproduces the problem
No response
Expected output
For instance
array{a: string|int}tryRemove HasOffsetValueType('a', int) should givesarray{a?: string}Did PHPStan help you today? Did it make you happy in any way?
No response