Skip to content

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

Open
@kkmuffme

Description

@kkmuffme

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions