Skip to content

Commit a408a58

Browse files
committed
Revert src/Rules/MissingTypehintCheck.php
1 parent 120d347 commit a408a58

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Rules/MissingTypehintCheck.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ public function getNonGenericObjectTypesWithGenericClass(Type $type): array
108108
if ($type instanceof TemplateType) {
109109
return $type;
110110
}
111-
if ($type->isObject()->yes()) {
112-
if (count($type->getObjectClassReflections()) === 0) {
111+
if ($type instanceof ObjectType) {
112+
$classReflection = $type->getClassReflection();
113+
if ($classReflection === null) {
113114
return $type;
114115
}
115-
$classReflection = $type->getObjectClassReflections()[0];
116116
if (in_array($classReflection->getName(), self::ITERABLE_GENERIC_CLASS_NAMES, true)) {
117117
// checked by getIterableTypesWithMissingValueTypehint() already
118118
return $type;
@@ -128,7 +128,7 @@ public function getNonGenericObjectTypesWithGenericClass(Type $type): array
128128
}
129129

130130
$resolvedType = TemplateTypeHelper::resolveToBounds($type);
131-
if (!$resolvedType->isObject()->yes()) {
131+
if (!$resolvedType instanceof ObjectType) {
132132
throw new ShouldNotHappenException();
133133
}
134134

0 commit comments

Comments
 (0)