Skip to content
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

Non-existent arguments should probably give an error #3166

Closed
vudaltsov opened this issue Apr 17, 2020 · 4 comments · Fixed by #9314
Closed

Non-existent arguments should probably give an error #3166

vudaltsov opened this issue Apr 17, 2020 · 4 comments · Fixed by #9314

Comments

@vudaltsov
Copy link
Contributor

Over the time I find a lot of useless @param phpdocs in my project. They are for arguments that no longer exist. It would be nice if psalm could point them out.

https://psalm.dev/r/ca86c581f6

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/ca86c581f6
<?php

/**
 * @param string $x
 * @psalm-param string $y
 */
function a(): void {}
Psalm output (using commit 5ef82b5):

No issues!

@muglug
Copy link
Collaborator

muglug commented Apr 17, 2020

I've always thought of this as more of a code style issue – if someone created a PR, and made it something that only appeared with --find-unused-code I'd happily accept it

@weirdan
Copy link
Collaborator

weirdan commented Feb 16, 2023

Original snippet now reports a couple of UnusedDocblockParams: https://psalm.dev/r/ca86c581f6

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/ca86c581f6
<?php

/**
 * @param string $x
 * @psalm-param string $y
 */
function a(): void {}
Psalm output (using commit f70f651):

ERROR: UnusedDocblockParam - 4:18 - Docblock parameter $x in docblock for a does not have a counterpart in signature parameter list

ERROR: UnusedDocblockParam - 5:24 - Docblock parameter $y in docblock for a does not have a counterpart in signature parameter list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants