Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect behavior of StaticCallOnNonStaticToInstanceCallRector #7974

Closed
klimslim opened this issue Jun 6, 2023 · 2 comments
Closed

Incorrect behavior of StaticCallOnNonStaticToInstanceCallRector #7974

klimslim opened this issue Jun 6, 2023 · 2 comments
Labels

Comments

@klimslim
Copy link

klimslim commented Jun 6, 2023

Bug Report

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

Minimal PHP Code Causing Issue

See https://getrector.com/demo/3bd88d14-d526-4771-abd5-ef9196a390da

<?php
class Grandpa
{
    protected function test()
    {
        echo __METHOD__;
    }
}

class Father extends Grandpa
{
    protected function test()
    {
        echo 'I can do it myself';
    }
}

class Son extends Father
{
    protected function test()
    {
        Grandpa::test();
    }
}

Responsible rules

  • StaticCallOnNonStaticToInstanceCallRector

Expected Behavior

Rector should skip it as it's not a static call, it's the same as parent:: but skipping one or more class hierarchy level(s).

@klimslim
Copy link
Author

klimslim commented Jun 7, 2023

klimslim pushed a commit to klimslim/rector-src that referenced this issue Jun 7, 2023
klimslim pushed a commit to klimslim/rector-src that referenced this issue Jun 7, 2023
klimslim pushed a commit to klimslim/rector-src that referenced this issue Jun 7, 2023
klimslim pushed a commit to klimslim/rector-src that referenced this issue Jun 7, 2023
klimslim pushed a commit to klimslim/rector-src that referenced this issue Jun 7, 2023
klimslim pushed a commit to klimslim/rector-src that referenced this issue Jun 7, 2023
klimslim pushed a commit to klimslim/rector-src that referenced this issue Jun 7, 2023
TomasVotruba pushed a commit to rectorphp/rector-src that referenced this issue Jun 7, 2023
…'s method calls. (#4098)

[Issue 7974](rectorphp/rector#7974)

Co-authored-by: Alexey Klimko <aklimko@sugarcrm.com>
@samsonasik
Copy link
Member

Resolved at rectorphp/rector-src#4098

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants