-
Notifications
You must be signed in to change notification settings - Fork 428
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
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
40d1af5
Fix stale result cache for
staabm 6f89b5e
another repro
staabm 061b0b3
Update Bar.php
staabm 38408a9
fix
staabm 83e7a7a
Update Baz.php
staabm 5784d24
Update Baz.php
staabm 5e8d2e9
Create patch-1.patch
staabm fb79a04
fix
staabm 829837e
fix
staabm 14f6be8
fix
staabm 23a9f07
rm
staabm 5c128fe
Update e2e-tests.yml
staabm 7ebea2e
Update DependencyResolver.php
staabm 7c31f11
fix
staabm 0f45524
Update patch-1.patch
staabm d199efc
Revert "Update DependencyResolver.php"
staabm 1db3cce
remove require-extends test
staabm 66ab6c3
Update DependencyResolver.php
staabm 57fe500
Update e2e-tests.yml
staabm 6378180
phpstan-require-implements test
staabm dcedfed
fix
staabm 8dc51fe
fail
staabm e65877a
Update e2e-tests.yml
staabm 45bf532
fix
staabm 2ab33db
Revert "fix"
staabm e4ae550
fix
staabm 21bb4ad
Update DependencyResolver.php
staabm 60c25fe
Update DependencyResolver.php
staabm File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Access to an undefined property TestResultCache6\\\\Bar\\:\\:\\$s\\.$#" | ||
count: 1 | ||
path: src/Foo.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
diff --git b/e2e/result-cache-6/src/Baz.php a/e2e/result-cache-6/src/Baz.php | ||
index 4a94eb3ae..6fed0b9ec 100644 | ||
--- b/e2e/result-cache-6/src/Baz.php | ||
+++ a/e2e/result-cache-6/src/Baz.php | ||
@@ -4,5 +4,4 @@ namespace TestResultCache6; | ||
|
||
class Baz | ||
{ | ||
- public string $s; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
includes: | ||
- phpstan-baseline.neon | ||
|
||
parameters: | ||
level: 8 | ||
paths: | ||
- src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace TestResultCache6; | ||
|
||
/** | ||
* @phpstan-require-extends Baz | ||
*/ | ||
interface Bar | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace TestResultCache6; | ||
|
||
class Baz | ||
{ | ||
public string $s; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace TestResultCache6; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
class Foo | ||
{ | ||
|
||
public function doFoo(Bar $b): void | ||
{ | ||
echo $b->s; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^PHPDoc tag @phpstan\\-require\\-implements cannot contain non\\-interface type TestResultCache7\\\\Bar\\.$#" | ||
count: 1 | ||
path: src/Foo.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/e2e/result-cache-7/src/Bar.php b/e2e/result-cache-7/src/Bar.php | ||
index b698e695d..0bbcc3093 100644 | ||
--- a/e2e/result-cache-7/src/Bar.php | ||
+++ b/e2e/result-cache-7/src/Bar.php | ||
@@ -2,6 +2,6 @@ | ||
|
||
namespace TestResultCache7; | ||
|
||
-interface Bar | ||
+class Bar | ||
{ | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
includes: | ||
- phpstan-baseline.neon | ||
|
||
parameters: | ||
level: 8 | ||
paths: | ||
- src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace TestResultCache7; | ||
|
||
interface Bar | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace TestResultCache7; | ||
|
||
/** @phpstan-require-implements Bar */ | ||
trait Foo | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 fromsrc/
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.see failling test
and the fix