Skip to content

Commit

Permalink
Cleanup TypeComparator
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jun 30, 2024
1 parent e08473e commit f997ffd
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/NodeTypeResolver/TypeComparator/TypeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,7 @@ private function areArrayTypeWithSingleObjectChildToParent(Type $firstType, Type
$firstArrayItemType = $firstType->getItemType();
$secondArrayItemType = $secondType->getItemType();

if ($this->isMutualObjectSubtypes($firstArrayItemType, $secondArrayItemType)) {
return true;
}

if (! $firstArrayItemType instanceof GenericClassStringType) {
return false;
}

if (! $secondArrayItemType instanceof GenericClassStringType) {
return false;
}

// @todo resolve later better with template map, @see https://github.com/symplify/symplify/pull/3034/commits/4f6be8b87e52117b1aa1613b9b689ae958a9d6f4
return $firstArrayItemType->getGenericType() instanceof ObjectType && $secondArrayItemType->getGenericType() instanceof ObjectType;
return $this->isMutualObjectSubtypes($firstArrayItemType, $secondArrayItemType);
}

private function isMutualObjectSubtypes(Type $firstArrayItemType, Type $secondArrayItemType): bool
Expand Down

0 comments on commit f997ffd

Please sign in to comment.