Skip to content

integer type hints appearing as TypeHintMissing instead of ScalarTypeHintMissing #1394

@h-bragg

Description

@h-bragg

Since upgrading to 2.8.1 integer types on method arguments have been throwing TypeHintMissing instead of ScalarTypeHintMissing.

Config:

<?xml version="1.0"?> <ruleset name="graze/standards"> <description>The graze PHP coding standard as defined in graze/standards.</description> <rule ref="vendor/graze/standards/PHP/CodeSniffer/Graze/ruleset.xml" /> <rule ref="Squiz.Commenting.FunctionComment"> <exclude name="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing" /> </rule> </ruleset>

Code:

 /**  * @param callable $worker  * @param int $limit  */ public function receive(callable $worker, $limit = 1) { ... }

2.8.0:

$ docker run --rm -t -v $(pwd):/opt/graze/queue -w /opt/graze/queue graze/php-alpine:test vendor/bin/phpcs -p --warning-severity=0 -s src/ tests/ ...................................... Time: 1.49 secs; Memory: 10Mb

2.8.1:

$ docker run --rm -t -v $(pwd):/opt/graze/queue -w /opt/graze/queue graze/php-alpine:test vendor/bin/phpcs -p --warning-severity=0 -s src/ tests/ FILE: /opt/graze/queue/src/Client.php ---------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ---------------------------------------------------------------------- 71 | ERROR | Type hint "integer" missing for $limit | | (Squiz.Commenting.FunctionComment.TypeHintMissing) ----------------------------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions