1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-10 06:58:41 +01:00
psalm/src
Marco Pivetta 68d88c546b Load PHP-version-specific stubs based on analysis PHP version, and only when visiting stub files
While `visitPreloadedStubFiles` seemed to work at first, it led to overriding symbols declared by
PHP itself too eagerly.

By only loading PHP-version-specific stubs in `visitStubFiles`, we ensure that the reflection-declared
symbols take priority, and that our stubs overlay on top of that, without actually replacing the
symbol entirely, but rather merging with its definition.

This fixes current test failures too, and works with the code examples
from https://github.com/vimeo/psalm/pull/8722#issuecomment-1339711882
2022-12-08 18:22:51 +01:00
..
Psalm Load PHP-version-specific stubs based on analysis PHP version, and only when visiting stub files 2022-12-08 18:22:51 +01:00