Skip to content

Support versioned extension stub maps - #1887

Open
Simon Podlipsky (simPod) wants to merge 1 commit into
JetBrains:masterfrom
simPod:support-versioned-extension-stub-map
Open

Support versioned extension stub maps#1887
Simon Podlipsky (simPod) wants to merge 1 commit into
JetBrains:masterfrom
simPod:support-versioned-extension-stub-map

Conversation

@simPod

Copy link
Copy Markdown
Contributor

Summary

  • Generate a version-aware PhpStormStubsMap::EXTENSION_VERSIONS map for extension directories with suffixes like ds_v2 and couchbase_v2.
  • Keep the existing flat CLASSES, FUNCTIONS, and CONSTANTS maps backward-compatible by continuing to point them at default extension stubs.
  • Regenerate PhpStormStubsMap.php so consumers can select versioned extension symbols, such as Ds\\Seq from ds_v2, without losing the existing default ds map.

@simPod

Copy link
Copy Markdown
Contributor Author

Ivan Fedorov (@isfedorov) what can I do to move this forward

@isfedorov

Ivan Fedorov (isfedorov) commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Simon Podlipsky (@simPod) there are a couple of things:

  1. Initially, the script to generate this map was introduced in the scope of WI-46976 as a workaround for BetterReflection and PHP-Scoper's Reflector and commit was done by Théo FIDRY (@theofidry) so I wonder if such changes in the map can cause any issues with those tools (despite mentioned by you point 2) and cause any problems for other users. We need to add other interested persons to the review.
  2. If tools are ok with such changes, you need to update your fork (since a lot of changes were done in the test framework), and update test \StubTests\StubsStructureValidatorTest::checkGenerateStubsMapScript to properly validate the new structure of the map

@theofidry

Copy link
Copy Markdown
Contributor

So long as PhpStormStubsMap::CLASSES, FUNCTIONS and CONSTANTS are not touched, there should be no problem on PHP-Scoper side.

I do wonder however what is the expected behaviour there if a symbol is found for either versions, especially in the case where its definition changes from a version to another.

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