Skip to content

Squiz.Commenting.FunctionComment.MissingParamName false positive #535

Open
@simPod

Description

@simPod

Describe the bug

Squiz.Commenting.FunctionComment.MissingParamName is triggered for valid @param docblock

Code sample

<?php

declare(strict_types=1);

class X
{
    /**
     * @param array{
     *     ud: string
     * } $data
     */
    public function sfsd(array $data): void
    {
    }
}

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
phpcs: Squiz.Commenting.FunctionComment.MissingParamName: Missing parameter name

Expected behavior

No error

Versions (please complete the following information)

Operating System [e.g., Windows 10, MacOS 10.15]
PHP version 8.3
PHP_CodeSniffer version 3.10.1
Standard Squiz
Install type composer local

Please confirm

  • I have searched the issue list and am not opening a duplicate issue.
  • I have read the Contribution Guidelines and this is not a support question.
  • I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
  • I have verified the issue still exists in the master branch of PHP_CodeSniffer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions