We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 13fb5b1 commit faadcf4Copy full SHA for faadcf4
src/Analyser/MutatingScope.php
@@ -378,7 +378,13 @@ public function getAnonymousFunctionReturnType(): ?\PHPStan\Type\Type
378
379
public function getType(Expr $node): Type
380
{
381
- $key = $this->printer->prettyPrintExpr($node);
+ /** @var string|null $key */
382
+ $key = $node->getAttribute('phpstan_cache_printer');
383
+ if ($key === null) {
384
+ $key = $this->printer->prettyPrintExpr($node);
385
+ $node->setAttribute('phpstan_cache_printer', $key);
386
+ }
387
+
388
if (!array_key_exists($key, $this->resolvedTypes)) {
389
$this->resolvedTypes[$key] = $this->resolveType($node);
390
}
0 commit comments