zendframework/zf2 — pull request #5060 by bakura10 (2013-09-01 14:18:17+00:00)
Title: Add provides options trait

In ZF2 we introduced the "AbstractOptions" class. It is very handy and a lot of modules use them for options-only classes (mainly class that configure the module).

However, a lot of classes needs options, but are not semantically "options classes". Extending from AbstractOptions for such classes has also the drawback that it's impossible to extend from something else.

This is a simple trait that focuses on speed by assuming the underscore_separated convention that we used in ZF2. Maybe we could also introduce an interface. This could be very useful for factories, because we could write a factory that would fetch options and automatically inject them in the created object by using the setOptions method.