De-duplicate PHP version list and error comparison in handler.ts#14779
Open
iliaal wants to merge 1 commit into
Open
De-duplicate PHP version list and error comparison in handler.ts#14779iliaal wants to merge 1 commit into
iliaal wants to merge 1 commit into
Conversation
The full nine-version list was repeated as a literal in analyseResult and retrieveLegacyResult, and the five-field PHPStanError comparison was copied verbatim into createTabs and retrieveResult. Extract an ALL_PHP_VERSIONS constant and an errorsEqual() helper. Behaviour is unchanged. The per-version "ensure present" block in retrieveResult is left as-is on purpose, since it governs which versions get re-analysed for older snapshots.
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.
The nine-version PHP list was a literal in
analyseResultandretrieveLegacyResult, and the five-fieldPHPStanErrorcomparison was copied verbatim intocreateTabsandretrieveResult. Extracted anALL_PHP_VERSIONSconstant and anerrorsEqual()helper. Behaviour unchanged:errorsEqualmatches the original field-by-field comparison across 49 test pairs,tscis clean. The per-version "ensure present" block inretrieveResultis left as-is on purpose, since it controls which versions get re-analysed for older snapshots.Overlaps the request-typing PR (branch
refactor/playground-api-request-typing) inhandler.ts; rebase whichever merges second.