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

Duplicate issues reported when public method is removed on a parent class #388

Open
weirdan opened this issue Jan 3, 2022 · 4 comments
Open

Comments

@weirdan
Copy link
Contributor

weirdan commented Jan 3, 2022

Assume we have the following class hierarchy:

class A {
   public function m(): void {}
}
class B extends A {}
class C extends A {}

When A::m() is removed, BCC reports Method A#m() was removed 3 times, once for the base class and once more for every descendant.

@weirdan
Copy link
Contributor Author

weirdan commented Jan 3, 2022

https://github.com/vimeo/psalm/pull/7276/files resulted in 867 entries in changelog.

@Ocramius
Copy link
Member

Ocramius commented Jan 3, 2022

Yes, the duplication is annoying, but kinda necessary when inheritance involves third-party dependencies.

IMO it is not that problematic, compared to not having this reported at all 🤔

@weirdan
Copy link
Contributor Author

weirdan commented Jan 3, 2022

The problem is, BCC does not report the issue on the descendant class, it just repeats the same message:

  • [BC] Method A#m() was removed
  • [BC] Method A#m() was removed
  • [BC] Method A#m() was removed

At the very least I would expect something like this:

  • [BC] Method A#m() was removed
  • [BC] Method B#m() (inherited from A) was removed
  • [BC] Method C#m() (inherited from A) was removed

@Ocramius
Copy link
Member

Ocramius commented Jan 3, 2022

Makes sense - that is certainly something we can improve on!

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

No branches or pull requests

2 participants