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

ReferenceUsedNamesOnly allows partial uses in annotation even when denied

Open janedbal opened this issue 2 years ago • 0 comments

Given this config

<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
        <properties>
            <property name="allowPartialUses" value="false"/>
            <property name="searchAnnotations" value="true"/>
        </properties>
</rule>

And this analysed file

<?php

use Gedmo\Mapping\Annotation as Gedmo;

/**
 * @Gedmo\SoftDeleteable
 */
class SomeEntity {}

new Gedmo\SoftDeleteable();

I'm getting error only on line 10 (new), not on line 6 (annotation).

-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
 10 | ERROR | Partial use statements are not allowed, but referencing Gedmo\SoftDeleteable found.
    |       | (SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.PartialUse)
-----------------------------------------------------------------------------------------------------------

janedbal avatar Nov 01 '23 14:11 janedbal