Skip to content
This repository was archived by the owner on Jul 12, 2020. It is now read-only.

Stop rename local variables corrupting variables with similar names #45

Merged
merged 1 commit into from
Apr 14, 2015

Conversation

tomphp
Copy link
Contributor

@tomphp tomphp commented Dec 15, 2013

This PR fixes an issue where when renaming a local variable which appears on the same line as another variable which starts with the name of the variable being changed, then it corrupts the name of the other variable.

e.g. In the following situation

class X
{
    public function methodY()
    {
        $foo = 7;
        $foobaz = 5;

        $foo = $foo + $foobaz;
    }
}

If you use the rename local variable function to rename $foo to $bar then $foobaz on the line which says $foo = $foo + $foobaz; will mistakenly be renamed to $barbaz

@tomphp
Copy link
Contributor Author

tomphp commented Jan 4, 2014

This bug has been fixed in a previous PR but I think it's work keeping the test.

beberlei added a commit that referenced this pull request Apr 14, 2015
Stop rename local variables corrupting variables with similar names
@beberlei beberlei merged commit 7fc6349 into QafooLabs:master Apr 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants