Skip to content

LocallyCalledStaticMethodToNonStaticRector does not skip when doing static call using class name #8688

@nikolicaleksa

Description

@nikolicaleksa

Bug Report

Subject Details
Rector version last dev-main

Minimal PHP Code Causing Issue

See https://getrector.com/demo/81b063a7-d8ae-430b-be7d-172d411f5b7d

<?php

declare(strict_types=1);

namespace Rector\Tests\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\Fixture;

final class SkipPrivateStaticCallFromStatic
{
    public static function bar(string $input)
    {
        return SkipPrivateStaticCallFromStatic::reallyBar($input);
    }

    private static function reallyBar($input)
    {
        return $input . ' - bar';
    }
}

Expected Behaviour

Rector should skip if static call is done using the class name instead of self / static

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