Changing the visibility scope of parent methods in child classes
问题 I've got a Validator class and a UserValidator class which extends from it. My Validator has a public method setRule(...) with public visibility. When I extend from it I want to change the visibility of the setRule(...) parent method to private/protected within the child so that it's only visible for the child and no outsiders can call this method from the child. Is that possible? If so, how could I achieve it? 回答1: From an architectural point of view this is not recommended. As already