Skip to content

Fixing 'return new static()' not being covered by MakeInheritedMethodVisibilitySameAsParentRector#2082

Merged
TomasVotruba merged 6 commits intorectorphp:masterfrom
gnutix:MakeInheritedMethodVisibilitySameAsParentRector/adding-testcase
Oct 4, 2019
Merged

Fixing 'return new static()' not being covered by MakeInheritedMethodVisibilitySameAsParentRector#2082
TomasVotruba merged 6 commits intorectorphp:masterfrom
gnutix:MakeInheritedMethodVisibilitySameAsParentRector/adding-testcase

Conversation

@gnutix
Copy link
Copy Markdown
Contributor

@gnutix gnutix commented Oct 2, 2019

return new self(); was correctly handled, while return new static(); was not. Now both are.

Fixes #2057

…r : 'return new self();' works, 'return new static();' does not.
@TomasVotruba
Copy link
Copy Markdown
Member

Please always create a new fixture file, so the fix is more clear and tests as small & readable as possible

Could you make fix with it?

@gnutix
Copy link
Copy Markdown
Contributor Author

gnutix commented Oct 2, 2019

Fixed.

@gnutix
Copy link
Copy Markdown
Contributor Author

gnutix commented Oct 2, 2019

And if you don't mind, I felt like fixing the implemention, while I was at it. :)

@gnutix gnutix changed the title Add a failing test for MakeInheritedMethodVisibilitySameAsParentRector Fixing 'return new static()' not being covered by MakeInheritedMethodVisibilitySameAsParentRector Oct 2, 2019
@gnutix gnutix requested a review from TomasVotruba October 3, 2019 21:52
@TomasVotruba TomasVotruba merged commit be455c3 into rectorphp:master Oct 4, 2019
@TomasVotruba
Copy link
Copy Markdown
Member

Thank you 👍

@TomasVotruba TomasVotruba deleted the MakeInheritedMethodVisibilitySameAsParentRector/adding-testcase branch October 4, 2019 09:45
TomasVotruba added a commit that referenced this pull request Apr 16, 2022
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.

Protected/private constructors are turned into public

2 participants