zendframework/zf2 — pull request #3317 by lukenm (2012-12-31 05:33:22+00:00)
Title: Fixed FileGenerator::setUse() to ignore already added uses.

Multiple calls to setUse() with the same parameters was leading to multiple identical use statements being inserted in the generated file. This was causing a PHP Fatal error 'name is already in use' in the generated code.

This patch overcomes this by first testing whether the 'use' has been added to the $uses array. If it has, then it ignores it (doesn't add it again).