mirror of
https://github.com/danog/psalm.git
synced 2024-12-11 00:39:38 +01:00
Cleanup
This commit is contained in:
parent
e2da9c9dc4
commit
3f710a80af
@ -149,7 +149,6 @@ class ArrayTypeComparator
|
|||||||
|
|
||||||
if ($container_type_part instanceof TKeyedArray) {
|
if ($container_type_part instanceof TKeyedArray) {
|
||||||
if ($container_type_part->is_list) {
|
if ($container_type_part->is_list) {
|
||||||
/** @var TList|TNonEmptyList */
|
|
||||||
$container_type_part = $container_type_part->isNonEmpty()
|
$container_type_part = $container_type_part->isNonEmpty()
|
||||||
? Type::getNonEmptyListAtomic($container_type_part->getGenericValueType())
|
? Type::getNonEmptyListAtomic($container_type_part->getGenericValueType())
|
||||||
: Type::getListAtomic($container_type_part->getGenericValueType());
|
: Type::getListAtomic($container_type_part->getGenericValueType());
|
||||||
|
@ -2247,8 +2247,10 @@ class SimpleAssertionReconciler extends Reconciler
|
|||||||
if ($type->isArrayAccessibleWithStringKey($codebase)) {
|
if ($type->isArrayAccessibleWithStringKey($codebase)) {
|
||||||
if (get_class($type) === TArray::class) {
|
if (get_class($type) === TArray::class) {
|
||||||
$array_types[] = new TNonEmptyArray($type->type_params);
|
$array_types[] = new TNonEmptyArray($type->type_params);
|
||||||
} elseif (get_class($type) === TList::class) {
|
} elseif ($type instanceof TKeyedArray && $type->is_list) {
|
||||||
$array_types[] = Type::getNonEmptyListAtomic($type->type_param);
|
$properties = $type->properties;
|
||||||
|
$properties[0] = $properties[0]->setPossiblyUndefined(false);
|
||||||
|
$array_types[] = $type->setProperties($properties);
|
||||||
} else {
|
} else {
|
||||||
$array_types[] = $type;
|
$array_types[] = $type;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user