Policy to load stubs for PHP extensions (core, bundled, external, PECL) #8879
alies-dev
started this conversation in
Psalm development (AKA internals)
Replies: 3 comments 1 reply
-
Sounds good to me |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm not too convinced myself.
Dropping extension_loaded now,after we just released Psalm 5 in which the config can be set for the first time, will guarantee that CIs will fail everywhere because of missing extensions for no good reason.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the policy for PHP extensions?
When I run Psalm I see something like this:
composer.json file example:
ext types
There are few types of ext:
Additionally, different PHP versions have different bundled extensions, e.g. sodium was PECL ext and became bundled as of PHP 7.2.0.
how Psalm loads stubs for extensions
enableExtensions
keyThen load stubs:
psalm/src/Psalm/Config.php
Lines 2138 to 2143 in 6b3dd56
Recently a new way has been introduced (probably to load ext stubs on https://psalm.dev/ snippets): using
extension_loaded()
function, first time used in #7614 . I think it's save to treat ext-redis as a regular extension.proposals
extension_loaded
, instead, use existing 2 ways of doing this (using composer.json is consider as the best practice for doing this). Load all available ext stubs on psalm.dev (unless there are some conflicting). (a PR as an example Unify a way how to load stubs for extensions #8881)Beta Was this translation helpful? Give feedback.
All reactions