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

Overrided deprecated method should not be deprecated #3378

Closed
ossinkine opened this issue Jun 1, 2020 · 2 comments · Fixed by phpstan/phpstan-src#225
Closed

Overrided deprecated method should not be deprecated #3378

ossinkine opened this issue Jun 1, 2020 · 2 comments · Fixed by phpstan/phpstan-src#225

Comments

@ossinkine
Copy link

Bug report

Imagine we have two classes AbstractEvent and SpecificEvent extends AbstractEvent. AbstractEvent has getString method, SpecificEvent uses it. One day we decide this method shoud be placed in SpecificEvent but not in AbstractEvent and we create one more getString method in SpecificEvent and make AbstractEvent::getString deprecated. So we have the child class with the method and the parent class with the same deprecated method.

Code snippet that reproduces the problem

https://phpstan.org/r/4ff86893-71fd-46a6-8f53-ddef9a049d0d

Expected output

I think SpecificEvent::getString should not be deprecated.

@ondrejmirtes ondrejmirtes transferred this issue from phpstan/phpstan-deprecation-rules Jun 1, 2020
@ondrejmirtes
Copy link
Member

This needs change in this place: https://github.com/phpstan/phpstan-src/blob/f96e0de5924cab79e78f41c96a6e039a175f1849/src/PhpDoc/ResolvedPhpDocBlock.php#L548-L567 Basically it shouldn't be merged at all.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2021
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 a pull request may close this issue.

2 participants