1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00

Reuse code

This commit is contained in:
Daniil Gentili 2022-11-21 20:52:58 +01:00
parent bd9b77daee
commit 0345254635

View File

@ -3684,16 +3684,9 @@ class AssertionFinder
|| $atomic_type instanceof TKeyedArray
) {
if ($atomic_type instanceof TKeyedArray) {
$key_possibly_undefined = false;
foreach ($atomic_type->properties as $property_type) {
if ($property_type->possibly_undefined) {
$key_possibly_undefined = true;
break;
}
}
$key_type = $atomic_type->getGenericKeyType($key_possibly_undefined);
$key_type = $atomic_type->getGenericKeyType(
!$atomic_type->allShapeKeysAlwaysDefined()
);
} else {
$key_type = $atomic_type->type_params[0];
}