New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix stale result cache for require-extends/require-implements #2866
Conversation
This pull request has been marked as ready for review. |
../../bin/phpstan -vvv | ||
mv src/Baz.php.orig src/Baz.php | ||
echo -n > phpstan-baseline.neon | ||
../../bin/phpstan -vvv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried result-cache-8
after removing changes from src/
and it does not fail for me locally. Please first submit a draft PR with just the E2E tests so it's obvious they fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after having slept about it, I think the situation is as follows:
we only need to support require-extends
for result-cache invalidation because thats the only new part in the reflection hierarchy.
require-implements
works with reflection information which was available before, we just added some rules arround it.
Update Baz.php
This reverts commit 181a12b.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just figured out when @phpstan-require-implements
has to be handled in DependencyResolver.
/** @phpstan-require-implements Bar */
trait Foo
{
}
When the file with Bar
changes, we need to reanalyse trait Foo
, because the RequireImplementsRule might find some new error, or get rid of an existing error. Like for example when Foo
changes type from interface to class and so on.
Please write a failing E2E test number 7 with this use-case, make sure it fails, then fix it in DependencyResolver. Thanks :)
Thank you, I will have a look until monday |
took me a few attempts.. :-/. failling test in https://github.com/phpstan/phpstan-src/actions/runs/7518819436/job/20466608449?pr=2866 I think its ready for another round of review |
Thank you! |
refs #2856 (comment)