In a lot of my PHP projects, I end up with classes that have non-public functions that I don't intend to extend.
Is it best to declare these as protected, or private?
I can see arguments both ways - making them private is a far more conservative approach, but it can be argued that they could be made protected later if I want the method to be extended and it makes it clear which methods are extended by base classes.
On the other hand, is using private somehow antisocial, in that it impedes a theoretical future developer from extending my code without modification?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…