Skip to content

Store PhpStorm stub paths of enum methods in the reflection cache relative to the stubs root - #6886

Open
jack-worman wants to merge 1 commit into
phpstan:2.3.xfrom
jack-worman:cache-enum-method-stub-paths
Open

jack-worman wants to merge 1 commit into
phpstan:2.3.xfrom
jack-worman:cache-enum-method-stub-paths

Conversation

@jack-worman

@jack-worman jack-worman commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

The reflection cache of PHP built-in classes stored the stub path relative to the phpstorm-stubs root only for the reflection itself; the methods an enum gets from the engine (cases(), from(), tryFrom()) carry their own located source, which kept the absolute path. Loading such an enum from a cache filled by another installation (e.g. a cache directory shared between CI jobs checked out in different directories) crashed with "…/standard_10.stub" is not a file. Those paths are now stored relative too, and the cache key version is bumped because earlier releases sharing the cache would crash on the new entries' relative paths.

Closes phpstan/phpstan#15607

@jack-worman
jack-worman force-pushed the cache-enum-method-stub-paths branch 2 times, most recently from 4f36193 to 3a187d1 Compare October 30, 2026 12:37
@jack-worman
jack-worman force-pushed the cache-enum-method-stub-paths branch from 3a187d1 to 8156563 Compare October 30, 2026 17:16
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.

Internal error sometimes happening

1 participant