Skip to content

Incorrect behavior of RenameMethodRector #9200

@LordSimal

Description

@LordSimal

Bug Report

Subject Details
Rector version last dev-main
Installed as composer dependency

Minimal PHP Code Causing Issue

See https://getrector.com/demo/4004ecef-deb7-492c-b8aa-8849f70ce6c4

<?php

trait MyTrait
{
    public function method1()
    {
        return '';
    }
    
    public function method2()
    {
        $this->method1();
        return '';
    }
}

Responsible rules

  • RenameMethodRector

Expected Behavior

Rector should also change the $this->method1(); inside the method2() definition to $this->method3();

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