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.