Skip to content

How to auto-invalidate cache when custom rule is updated? #4691

Answered by ondrejmirtes
janedbal asked this question in Support
Discussion options

You must be logged in to vote

I was waiting for the right idea to implement this :) And last night it came: phpstan/phpstan-src@1e53ab6

It will work automatically - if the source file of a registered extension is modified, the cache gets invalidated. It works even for referenced files, so for example if you have MethodClassReflectionExtension that instantiates a custom MethodReflection implementation, when the MethodReflection class is modified, cache gets invalidated as well.

Please run the latest dev-master (be aware you can run into this issue #4715 but the analysis is fine otherwise) and check out the new projectExtensionFiles key in the saved result cache file - see if the list of files makes sense to you.

If you…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ondrejmirtes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants