-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
PHPStan error: "Unable to resolve the template type T" in DriverManager #4264
Comments
In my opinion this sort of error should not be shown to users of a static analysis tool — it’s rarely ever the users’ fault. |
FYI the annoying message about "unable to resolve template type" will no longer show up in these cases (because the template type is not present in the return type used by PHPStan): https://phpstan.org/r/3273047f-31d7-42bb-8763-357e10553eb5 Thanks to commit: phpstan/phpstan-src@a5f9f0c |
@pkruithof can you please try updating and report back? |
Thanks @ondrejmirtes BTW :) |
Unfortunately I cannot remember where I encountered this, and I can't find any references in our repositories to it anymore. 😅 I'll close the issue for now as I believe it should be resolved. Should I encounter it again I can always open a new ticket. |
@greg0ire last night phpstan was updated by Dependabot in the project that had this issue, and where we ignored the error to fix it. The ignore is no longer needed so I can confirm that the issue is indeed fixed. |
Great, thanks a lot! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Continued from #3977 (comment)
Support Question
As discussed in #3977, the annotations for the
DriverManager
class now result in a PHPStan error.dbal/lib/Doctrine/DBAL/DriverManager.php
Lines 116 to 130 in f97ee94
This error is currently ignored by this repo:
dbal/phpstan.neon.dist
Lines 101 to 106 in f97ee94
However the same error is reported in projects that use dbal (when they use the
DriverManager
of course), which I think should not happen. Here is the trimmed down version of the error case: https://phpstan.org/r/6ffb80b4-bb00-419d-bc98-887488e1c36bThe PHPStan author suggested a possible solution, which does not work unfortunately. So there is more investigation needed as to why this happens, and how to resolve it.
The text was updated successfully, but these errors were encountered: