Skip to content

Commit 4a143bd

Browse files
staabmondrejmirtes
authored andcommitted
Cache ClassReflections
1 parent 8612d23 commit 4a143bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Type/ObjectType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,10 +1739,10 @@ public function getClassReflection(): ?ClassReflection
17391739

17401740
$classReflection = $reflectionProvider->getClass($this->className);
17411741
if ($classReflection->isGeneric()) {
1742-
return $classReflection->withTypes(array_values($classReflection->getTemplateTypeMap()->map(static fn (): Type => new ErrorType())->getTypes()));
1742+
return $this->classReflection = $classReflection->withTypes(array_values($classReflection->getTemplateTypeMap()->map(static fn (): Type => new ErrorType())->getTypes()));
17431743
}
17441744

1745-
return $classReflection;
1745+
return $this->classReflection = $classReflection;
17461746
}
17471747

17481748
public function getAncestorWithClassName(string $className): ?self

0 commit comments

Comments
 (0)