-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove XFAIL from sibling method call test #8482
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
Conversation
This isn't about calling a protected (static) method in the parent class, but rather in a sibling class: graph TD;
A-->B1;
A-->B2;
Should |
I think, this being long-standing behaviour, we should reach consensus to not consider that a bug, but a feature. As such, I support removing this XAFIL. The justification for this behaviour should be that the sibling class' static should be considered an override in the parents scope (given that static methods are also subject to inheritance / LSP, they are guaranteed to be compatible). I.e. a caller of the siblings function can know with certainty that a compatible Basically, visibility does not hide things which are known to exist, but it decides whether things are known at all. Given that the parent already makes the function known, the visibility of the child is irrelevant. |
b6b975c
to
0b2b4fa
Compare
0b2b4fa
to
cf85aeb
Compare
@cmb69 yes :), I updated the title and improved the tests to test calls to sibling method /w and /wo definition in a parent class. Yes, this is the only consistent way to satisfy LSP, if shared parent has some interface, the interface must be simply available. |
4e139c6
to
2c89995
Compare
Is there a reason this targets |
it removes 2 XFAILs from PHP 8.0/8.1 CI and asserts the current behaviour as it is correct (explained/discussed above) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine for master. The tested behavior is consistent with prototype inheritance rules. (Our actual implementation is not entirely correct due to a bi-directional inheritance check, but this behavior is not being tested here.)
2c89995
to
ae5f1cd
Compare
I belive the XFAIL is not needed. Method defined in shared parent class MUST be accessible even if redeclared in sibling class.