slevomat / coding-standard

Slevomat Coding Standard for PHP_CodeSniffer provides many useful sniffs
MIT License
1.39k stars 171 forks source link

How to pass empty array for property? #1659

Closed darius-v closed 6 months ago

darius-v commented 8 months ago
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
        <properties>
            <property name="traversableTypeHints" type="array" value=""/>
        </properties>
    </rule>

I cannot find example in the docs how to turn off those traversableTypeHints. As I understand I need to define array of type hints which I want to enforce so they would give me erorrs. So if I do not enforce any, I have to pass empty array. But this still gives me errorr

50 | ERROR | Method 517 | | \App\ClientManagement\Data\TimesOverlapValidatorInputs\OverlapValidatorInput::getClientAircraftIds() 518 | | does not have @return annotation for its traversable 519 | | return value.

for this method:

public function getClientAircraftIds(): array
{
    return $this->clientAircraftIds;
}
kukulich commented 8 months ago

You can disable reporting specific error codes