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

SlevomatCodingStandard.TypeHints.ParameterTypeHint false posivite when DNF is the last type in union #1690

Open
LastDragon-ru opened this issue Jul 19, 2024 · 0 comments

Comments

@LastDragon-ru
Copy link

<?php declare(strict_types = 1);

interface A {}

interface B {}

interface C {}

interface D {}

interface Bug {
    public function bug(
        (A&B)|C|D $a,
        A|(B&C)|D $b,
        A|B|(C&D) $c,
    ): void;
}
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="./vendor-bin/phpcs/vendor/squizlabs/php_codesniffer/phpcs.xsd">
    <config name="installed_paths" value="../../slevomat/coding-standard"/>
    <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"/>
</ruleset>

Reports that:

14 | ERROR | Method \Bug\Bug::bug() does not have parameter type hint nor @param annotation for its parameter $c.
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