Repository navigation
Do not count a moved symbol as a new one in the result cache - #6728
Open
SanderMuller wants to merge 1 commit into
Open
SanderMuller wants to merge 1 commit into
SanderMuller wants to merge 1 commit into
Conversation
compareExportedNodes() compared the symbol names of a file as ordered lists, so swapping two define() calls or two classes looked like a new symbol. That re-analysed every file with errors. The symbols are now grouped by type and name, and only the order within the same symbol still counts. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
compareExportedNodes()compared the symbol names of a changed file as ordered lists. When a file swapped twodefine()calls or two classes,restore()saw a new symbol and re-analysed every file with errors.The symbols are now grouped by type and name. When a file declares the same symbol twice, the two declarations still compare in the order of the file.
WordPress/wordpress-develop@7111d25 moves
define( 'ABSPATH' )insetup-config.php. I ran WordPress'stests/phpstan/base.neonwith phpstan-phpunit at level 5, without its baseline, and with a warm cache from the parent commit. 2.3.x at 184d34e re-analyses 311 files, and this branch re-analyses 1. Both report the same 1487 errors, and so does a run with an empty cache.The new e2e fixture
result-cache-reordered-symbolsswaps twodefine()calls and two classes, and expects 1 file to analyse. Without the source change it gets 2.I also checked these cases with a file that reads the constant and a separate file that has an error. In each one the warm run reports the same errors as a cold run.
define()still re-analyses every file with errors.define()calls with the same name and swapped values re-analyse the file that reads the constant.🤖 Generated with Claude Code