-
Notifications
You must be signed in to change notification settings - Fork 651
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 throw an InvalidDocblock error if a parameter is missing a type #20
Comments
I don't particularly want to go down the path of Psalm alerting the user to issues that can be better found with |
Hmm I'm not sure that's the right call @muglug. If I create a docblock with params, I expect Psalm to validate against that docblock. If I accidentally leave the type out, then psalm just wouldn't validate against that docblock. But it would be completely silent about it. So I would think it was validating against the docblock, but it actually wouldn't be. Given how heavily Psalm relies on docblocks for validation, I think it's completely reasonable for it to check that the docblocks are accurate and it seems like phpcs shouldn't be required to make sure Psalm is analyzing things fully. The intent of phpcs is to check style, whereas the intent of Psalm is to check correctness. You shouldn't have to check your style first in order to fully check your correctness. |
It's also really edge-casey, but Psalm throwing exceptions for a missing variable in the method where a documented |
That's a good point, but the existing @psalm-variadic annotation should be
enough to tell psalm how to handle that
…On December 24, 2016 at 10:46:04 PM, Jon Ursenbach ***@***.***) wrote:
It's also really edge-casey, but Psalm throwing exceptions for a missing
variable in the method where a documented @param is present might be
weird for instances where the dev is using func_get_args for processing
params.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#20 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABU0d2w0MYPxuHt68g9cNTbxbATeqQ2Tks5rLhEsgaJpZM4LOVyk>
.
|
<3 <3 <3
…On December 25, 2016 at 3:32:29 AM, Matthew Brown ***@***.***) wrote:
Closed #20 <#20> via b6eea4e
<b6eea4e>
.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#20 (comment)>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ABU0d0iL5AueoacxreajKTNygyVZ13BAks5rLlRNgaJpZM4LOVyk>
.
|
Merry merry! |
Paste
into getpsalm.org.
Observed: No errors
Expected: InvalidDocblock because
@param $bar
is missing a typeThe text was updated successfully, but these errors were encountered: