New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecation: Psalm stubs for ext-apcu loaded using legacy way. #8958
Comments
Hey @michnovka, can you reproduce the issue on https://psalm.dev ? |
This is unreproducible with psalm.dev |
Those are extensions that are loaded in your current PHP installation (we retrieve those through extension_loaded: Line 2142 in 1c19260
Historically, Psalm used to have every extension symbol automatically known. This was having weird effects when users declared those symbol but did not have that specific extension. We're changing things in order to have a better workflow here We created separate stubs for extensions and we only load them when we detect an extension;
We wish to deprecate the first possibility, but for better migration, we're warning users that they will have to migrate extensions to one of the other possibility. If you don't wish to enable the extensions we warn about, just ignore the deprecation, we'll disable those when we finish the migration. Otherwise, please add them in composer or in config. |
@orklah maybe we can introduce some psalm.xml config option to suppress these messages? I keep all my requirements correctly included in composer.json. Still, my PHP installation has maybe few extra extensions. But this does not mean I need to load their stubs for my project. So while I get the reason for the warning, if a user sees it, they decide its OK, adding an option into psalm.xml to suppress them would be welcome. WDYT? |
I think the ideal option for this case will be to use However, I haven't tested how they works in this combination. I'll test it this week, if doesn't work - I'll create a PR |
I have the same issue with According to https://php.watch/versions/8.2/ext-random, the random extension is loaded automatically in 8.2, so in this case the deprecation message might be false. |
the fixed version is on master branch. As for issue raised by @ThomasLandauer, we need to find another solution. I will try to find something not complex to solve this (different PHP versions have different bundled/core php ext, it's also possible to compile PHP with/without some of them, it's possible to disable some ext in .ini, we can write a comprehensive solution for this, but I don't think we should increase complexity of the project on such non-major functionality). UPD: There is a PR for that: https://github.com/vimeo/psalm/pull/9099/files UPD 2: It's fixed and merged. The fix on master and will be shipped within next release (next after 5.4.0) |
I tried to get rid of these deprecation messages, unfortunately
|
@iquito $ psalm --version
Psalm 5.6.0@e784128902dfe01d489c4123d69918a9f3c1eac5 |
I have lot of these warnings in my psalm output:
My project does not use apcu, nor redis. It is not inside psalm.xml nor inside composer.json.
Why are these extensions even loaded?
The text was updated successfully, but these errors were encountered: