diff --git a/packages/NodeTypeResolver/TypeAnalyzer/CountableTypeAnalyzer.php b/packages/NodeTypeResolver/TypeAnalyzer/CountableTypeAnalyzer.php index 0717d2d95b1e..a6a7e77c9dc8 100644 --- a/packages/NodeTypeResolver/TypeAnalyzer/CountableTypeAnalyzer.php +++ b/packages/NodeTypeResolver/TypeAnalyzer/CountableTypeAnalyzer.php @@ -65,7 +65,7 @@ private function isCountableObjectType(Type $type): bool if ($type instanceof ObjectType) { foreach ($countableObjectTypes as $countableObjectType) { - if (! is_a($type->getClassName(), $countableObjectType->getClassName(), true)) { + if ($countableObjectType->isSuperTypeOf($type)->no()) { continue; }