zendframework/zf2 — pull request #1115 by Ocramius (2012-04-30 19:00:43+00:00)
Title: Adding failing test for duplicate injections caused by inheritance

This added failing test demonstrates how injections are duplicated when a setter is available both in a retrieved instance and its superclass.

I'm opening the PR to request some suggested fixes. The affected code looks like the the two loops at https://github.com/zendframework/zf2/blob/717082faaffa81bf83857731f9747570b3a39682/library/Zend/Di/Di.php#L210-221
Ideas about how this could be handled? I was thinking about making a subtraction of calls to supertype methods when the supertype method corresponds to the child class method and the parameters are also the same. Something like `when method has already been called with the same parameters, then continue`.