Skip to content

De-duplicate PHP version list and error comparison in handler.ts#14779

Open
iliaal wants to merge 1 commit into
phpstan:2.2.xfrom
iliaal:refactor/playground-api-dedup
Open

De-duplicate PHP version list and error comparison in handler.ts#14779
iliaal wants to merge 1 commit into
phpstan:2.2.xfrom
iliaal:refactor/playground-api-dedup

Conversation

@iliaal
Copy link
Copy Markdown

@iliaal iliaal commented Jun 5, 2026

The nine-version PHP list was a literal in analyseResult and retrieveLegacyResult, and the five-field PHPStanError comparison was copied verbatim into createTabs and retrieveResult. Extracted an ALL_PHP_VERSIONS constant and an errorsEqual() helper. Behaviour unchanged: errorsEqual matches the original field-by-field comparison across 49 test pairs, tsc is clean. The per-version "ensure present" block in retrieveResult is 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) in handler.ts; rebase whichever merges second.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant