Skip to content

FunctionComment sniff only corrects last param in list #2945

Open
@ElvenSpellmaker

Description

@ElvenSpellmaker

In this file: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php

On lines 388-390:

                if (count($typeNames) > 1) {
                    continue;
                }

This means it skips the PHP version checking below on line 404, and so it incorrectly expects integer|float, rather than int|float on PHP 7.

If you flip these arguments it expects float|int rather than float|integer (which is correct but not consistent.)

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