As example in Menu methods addMenu, addGroup, addMenuRight use static::addTo.
I had defined a child class NavMenu extending Menu.
When calling the addMenu method within the new class the expected behavior is that a Menu is added (as original behavior) and not NavMenu (as happens now).
Using self instead of static in Menu methods does not solve the issue. Only using Menu::addTo results in expected behavior. That is because static is used in addTo method as well.
All classes using addTo must be checked for this.
As example in
MenumethodsaddMenu,addGroup,addMenuRightusestatic::addTo.I had defined a child class
NavMenuextendingMenu.When calling the
addMenumethod within the new class the expected behavior is that aMenuis added (as original behavior) and notNavMenu(as happens now).Using
selfinstead ofstaticinMenumethods does not solve the issue. Only usingMenu::addToresults in expected behavior. That is becausestaticis used inaddTomethod as well.All classes using
addTomust be checked for this.