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

Unsealed array shapes false positive error for Squiz.Commenting.FunctionComment.MissingParamTag and Squiz.Commenting.FunctionComment.MissingParamName #3734

Open
kkmuffme opened this issue Dec 23, 2022 · 0 comments

Comments

@kkmuffme
Copy link

Describe the bug
Unsealed array shapes (https://psalm.dev/docs/annotating_code/type_syntax/array_types/#:~:text=theory%20perspective.-,Unsealed%20array%20and%20list%20shapes,-Starting%20from%20Psalm) create a false positive error with these rules:

  • Squiz.Commenting.FunctionComment.MissingParamName
  • Squiz.Commenting.FunctionComment.MissingParamTag

Code sample

	/**
	 * do something
	 *
	 * @param array{foo: string, bar: string, ...} $data some data
	 *
	 * @return array<string, string>
	 */
	function foo( $data ) {}

To reproduce
Steps to reproduce the behavior:

  1. Create a file called test.php with the code sample above
  2. Run phpcs test.php ...
  3. See error message displayed
Doc comment for parameter "$data" missing
Missing parameter name

Expected behavior
No error.

Versions (please complete the following information):

  • OS: RHEL 8
  • PHP: 7.4
  • PHPCS: master
  • Standard: Squiz
NaokiTsuchiya added a commit to NaokiTsuchiya/BEAR.Package that referenced this issue Jan 6, 2023
GromNaN added a commit to mongodb/mongo-php-library that referenced this issue Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant