Page 3 of 3

Re: private constants

Posted: Mon Jan 19, 2009 5:06 am
by Jenk
Yes, that is a caveat on it. I do regularly use private properties myself, but my beef is not having access to them at all, rather than directly via $obj->_prop, infact I'd much rather have an accessor (and mutator if needed.) The previous example I gave, would actually be better solved with a factory that I can have a 'test mode' on, so that the factory returns the mock when in testing mode, and the normal stream when not.