Skip to content

Select versioned extension stubs - #6250

Merged
ondrejmirtes merged 1 commit into
phpstan:2.2.xfrom
simPod:feat/ext-ds-v2-stubs
Sep 15, 2026
Merged

ondrejmirtes merged 1 commit into
phpstan:2.2.xfrom
simPod:feat/ext-ds-v2-stubs

Conversation

@simPod

@simPod simPod commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Adds Composer-based extension-major selection for PhpStorm stubs.

Uses the selected map for internal reflection, keeps cache entries separate by selection, and applies the ext-ds v1 overlay only when no versioned ext-ds map is selected.

@simPod
simPod force-pushed the feat/ext-ds-v2-stubs branch 2 times, most recently from 987a117 to b69977f Compare August 24, 2026 13:13
@ondrejmirtes
ondrejmirtes marked this pull request as ready for review September 15, 2026 16:20
@phpstan-bot

Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes
ondrejmirtes force-pushed the feat/ext-ds-v2-stubs branch 2 times, most recently from d6de075 to c3ff432 Compare September 15, 2026 18:45
Detect the major version of extensions with versioned PhpStorm stub maps
(ext-ds 1 vs 2) from the project's composer.json platform config, its
require constraint, or the loaded extension, and pass it to
PhpStormStubsSourceStubber. The ext-ds 1 stub overlay is only loaded for
ds 1, and the detected versions are part of the internal stubs cache key.

In the result cache, files using built-in symbols of such an extension
record a dependency on its platform package (ext-<name>) next to their
Composer package dependencies. A different selected version then
re-analyses only those files and the files with errors instead of the
whole project.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ondrejmirtes
ondrejmirtes merged commit 677df31 into phpstan:2.2.x Sep 15, 2026
856 of 889 checks passed
@ondrejmirtes

Copy link
Copy Markdown
Member

Thank you!

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.

3 participants