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
psalm doesn't recognize some grpc classes & constants #6796
Comments
I found these snippets: https://psalm.dev/r/60285c8421<?php
use Grpc\ChannelCredentials;
$c = ChannelCredentials::createInsecure();
https://psalm.dev/r/608770e40d<?php
use Grpc\STATUS_OK as GRPC_STATUS_OK;
echo GRPC_STATUS_OK;
|
Does it work with |
@weirdan yes! I guess it's indeed because of https://github.com/vimeo/psalm/blob/master/src/Psalm/Internal/Cli/Psalm.php#L895? Out of curiosity, what's the background here for having to disable the extension if |
I'm starting to wonder if we should really require having enabled extensions in order to use the signatures in callmaps. There's a few other issues that are related where people are suprised the signature they documented are not used because they lack the extension. Here it's even worse because we disable the extension ourselves |
Sorry for no documentation — I added this code because of this bug (the same was true I think of the APC extension). Since that issue has been fixed for a few years, and users can selectively disable extensions anyway, it should be good to remove this exception. |
Happy to provide a PR if necessary 🖖 |
From the discussion on the linked issue:
So I suspect we would still have to have some special treatment for grpc ext, e.g. check if the environment var is set and warn + downgrade to single thread otherwise. |
psalm seems to have some trouble recognizing some grpc classes and constants.
Despite having the extension enabled, the following code fails https://psalm.dev/r/60285c8421.
Additionally, all the constants from the
Grpc
namespace are also not recognized, eg: https://psalm.dev/r/1a904c1046.I noticed that there are some stubs defined in the
dictionaries/CallMap.php
and also that some internal psalm code disables thegrpc
extension under some circumstances, so I'm wondering if that could have anything to do with it.Any help or hints would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered: