|
Posted by Daniel Klein on 09/28/46 12:01
I've got a class that has a couple of methods that can't be 'private' cos
they can be called by other classes in the project, but they should not be
called by user code, so I've had to make them 'public'. In other languages
these methods would have 'friend' visibility.
I suspect there is no 'friend' access modifier since php has no concept of a
'module' or 'assembly' (at least none that I am aware of).
I'm use to coding in dynamic languages where you use the 'honor system'. For
example, in python you indicate this by placing an underscore character in
front of the method/function. You also document the method to indicate your
intentions. So unless there is a similar php convention, I am more than ok
doing it that way.
So my question is: What is the php way of doing this?
Daniel Klein
Navigation:
[Reply to this message]
|