coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

How to pass empty array for property?

Open darius-v opened this issue 1 year ago • 1 comments

<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;
}

darius-v avatar Jan 30 '24 14:01 darius-v

You can disable reporting specific error codes

kukulich avatar Jan 30 '24 14:01 kukulich