Skip to content

Conversation

samsonasik
Copy link
Member

Closes #5564

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba
Copy link
Member

Thank you 👍

@TomasVotruba TomasVotruba merged commit 0b17b91 into master Feb 19, 2021
@TomasVotruba TomasVotruba deleted the close-5564 branch February 19, 2021 09:28
@ruudk
Copy link
Contributor

ruudk commented Feb 19, 2021

Thanks!!

ruudk added a commit to ruudk/rector that referenced this pull request Feb 22, 2021
rectorphp#5622  only partially fixed the problem. It should also check if `$methodCallRename->getOldClass()` is an interface, and skip that too
ruudk added a commit to ruudk/rector that referenced this pull request Feb 22, 2021
I realized that I did not provide the test case in rectorphp#5564 correctly as I was running it in my project.

By changing the existing test it fails again.

Why? Because `OtherWildcardSubscriber` does match the wildcard `*WildcardSubscriber`. That one does not implement an interface.

Because `$this->classManipulator->hasParentMethodOrInterface` just tries to find the first matching class that matches the wildcard, it checks that one always.

That means that the implementation in rectorphp#5622 is not correct (and naive).
ruudk added a commit to ruudk/rector that referenced this pull request Feb 22, 2021
ruudk added a commit to ruudk/rector that referenced this pull request Feb 22, 2021
I realized that I did not provide the test case in rectorphp#5564 correctly as I was running it in my project.

By changing the existing test it fails again.

Why? Because `OtherWildcardSubscriber` does match the wildcard `*WildcardSubscriber`. That one does not implement an interface.

Because `$this->classManipulator->hasParentMethodOrInterface` just tries to find the first matching class that matches the wildcard, it checks that one always.

That means that the implementation in rectorphp#5622 is not correct (and naive).
TomasVotruba added a commit that referenced this pull request Feb 16, 2024
rectorphp/rector-src@39d9c32 [Php83] Early check private method in child before check parent on AddOverrideAttributeToOverriddenMethodsRector (#5622)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants