@Danack Parent is referencing FooInterface. The child has ConcreteFoo injected into it. I want to access the methods of ConcreteFoo rather than FooInterface. Now that I think about it, I shouldn't even have an interface if the concrete versions are mostly different. I need to group them somehow though...
does anybody know whether you can override @property or @param annotations in child classes without redefining the parent property? for example, Child extends Parent. the constructor for Parent takes an interface and sets it as a protected property. I'd like to my IDE to pick up type hints for that property in Child -- but the parent's protected property only references the interface, not the concrete class.
@DaveRandom hmm. The trick is to find where refs are still active for the unset instances. Do you have any advice or tooling recommendations for tracking these types of memory leaks? I guess the obvious choice is xdebug
@DaveRandom so if you do have stragglers still referencing these instances, there's no real way to remove them until the request/script execution ends?
@DaveRandom thanks - somebody is trying to unset a bunch of objects and doing a memory_get_usage afterwards, which is still showing allocated memory. Is there any way to trigger the GC to release it?
I've laid out all the technical reasons in the mailing list, and they're still not getting it - so probably worth reaching some kind of compromise (protected visibility)
@RonniSkansing I want to introduce private visibility and perhaps even final keywords into a project. I firmly believe in strong encapsulation and that inheritance is often an anti-pattern. But some contributors are uncertain, so I'm trying to anticipate counter-arguments
@RonniSkansing if you're using private visibility extensively, you are enforcing strict encapsulation; i.e. preventing child classes from accessing properties from classes they inherit. That is a deliberate restriction - how is that not a matter of flexibility?
@DaveRandom again, exactly right - but it boils down to this, how strongly should you enforce these OO principles on a public project where the majority of consumers just want things to work
@DaveRandom exactly, but that's not an opinion shared by others. They think using private visibility is an unnecessary restriction placed on end-users not being able to override the class.
@ircmaxell a while back you said that objects should either maintain state (like a value-object) or perform behavioural concepts (do-ers). Why is that important? How can you apply that to decomposition etc.
if you have a bunch of models which are almost always populated by arrays - is it better to accept an array in the constructor; or use a static factory method for the array, and populate constructor with property arguments