Fix result cache invalidation with @var referenced classes - #6343
Conversation
|
Thanks! I was worried about the performance hit, so I instrumented the Good news: for Two redundancies though:
Please restrict the new branch to the statements if (
$node instanceof Node\Stmt
&& !$node instanceof VirtualNode
&& !$node instanceof Node\Stmt\ClassLike
&& !$node instanceof Node\Stmt\ClassMethod
&& !$node instanceof Node\Stmt\Function_
&& !$node instanceof Node\Stmt\Property
&& !$node instanceof Node\Stmt\ClassConst
&& !$node instanceof Node\Stmt\Const_
) {
$this->extractStmtVarTags($node, $scope, $dependenciesReflections);
}I verified this variant: 251 calls, all cache hits, miss count identical to the branch without the PR, and your e2e test still passes (and fails without the fix). Also please remove the |
|
I like it, just run |
|
I'm sorry, there's now a conflict. I was fixing some result cache misses too. |
|
Rebase the branch so that the history is linear and clean. |
# Conflicts: # .github/workflows/e2e-tests.yml
# Conflicts: # src/Dependency/DependencyResolver.php
|
Thank you! |
My project started encountering stale result cache entries after updating to lvl7. Found that the result cache does not register a file dependency for a class that is only referenced by
@varPHPDoc, like how phtml template files commonly do.Not sure if there's more elegant way to do this?