mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 17:52:45 +01:00
Reuse code
This commit is contained in:
parent
bd9b77daee
commit
0345254635
@ -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];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user