Skip to content

Squiz.SelfMemberReference.NotUsed not detected if leading namespace separator is used #1072

Closed
@nkovacs

Description

@nkovacs

\Foo should be replaced with self, but it's not detected by the sniff because of the leading namespace separator:

class Foo
{
    public static function bar()
    {
        \Foo::baz();
    }

    public static function baz()
    {
        echo 'foobar';
    }
}

Foo::bar();

Failing test: nkovacs@2847398

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