[WIP] [DX] Add prototype for scope refresh issues#1297
Closed
TomasVotruba wants to merge 9 commits intomainfrom
Closed
[WIP] [DX] Add prototype for scope refresh issues#1297TomasVotruba wants to merge 9 commits intomainfrom
TomasVotruba wants to merge 9 commits intomainfrom
Conversation
498126a to
99f266f
Compare
TomasVotruba
commented
Nov 24, 2021
Comment on lines
+266
to
273
| // refresh PHPStan scope, parent connections and other attributes | ||
| $scope = $node->getAttribute(AttributeKey::SCOPE); | ||
| $parent = $node->getAttribute(AttributeKey::PARENT_NODE); | ||
| $this->phpStanNodeScopeResolver->refreshStmtNodes($parent, [$node], $scope); | ||
|
|
||
| // update parents relations - must run before connectParentNodes() |
Member
Author
There was a problem hiding this comment.
This is the important change. On changed node, all the children of this node and this node get retraverse of scope.
TomasVotruba
commented
Nov 24, 2021
Comment on lines
+39
to
+43
| foreach ($itemsByName as $items) { | ||
| if (count($items)) { | ||
| continue; | ||
| } | ||
| } |
Member
Author
There was a problem hiding this comment.
Before this change, the type was lost on $values renamed to $items.
Now the $items have the ArrayType as original $values have 👍
0ef1a51 to
061f54b
Compare
samsonasik
requested changes
Nov 24, 2021
Member
samsonasik
left a comment
There was a problem hiding this comment.
To show that the refresh scope working, the part that can be removed is second parameter bool $isCheckNameScope = false at:
After removed, run tests against tests/Issues:
vendor/bin/phpunit tests/Issuesand verify if it cause error or not.
This was referenced Nov 24, 2021
2ae2cde to
e98e2fd
Compare
e5c965b to
29d211d
Compare
50f1565 to
f204f29
Compare
f204f29 to
312de27
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ref rectorphp/rector#6723