zendframework/zf2 — pull request #4575 by bakura10 (2013-06-02 10:53:10+00:00)
Title: [ZF3] [WIP] Refactor Filter component

Hi,

As the discussion of ZF 3 is starting, I'm trying to refactor some components that need it. As @weierophinney and @ocramius knows I'm starting to refactor InputFilter, but in order to make it properly, some changes needs to be done in the Filter and Validator components too.

I'm starting the Filter one as this is the most easy one. Here are current things I've done:

- To be more homogeneous, each filter that needs options extend the AbstractOptions class. Now options must be specified using underscore_separated.
- As a consequence, I've removed completely the fluent interface (as now most options will be specified through the constructor directly).
- As ZF3 will be PHP 5.4, I've removed a lot of boilerplate code to take advantage of Callable typehint.
- I've simplified drastically the FilterChain implementation. It was doing too much things (the setOptions acted as a factory to create filter using config, but it's not the task of the Filter chain). The creation should be hnadled by the Factory of the InputFilter class. Now, because the FilterChain does not create filters on itself, it does not have reference to the FilterPluginMnager. It will make things A LOT simpler for components that rely on Filter component like InputFilter. Injection will be simpler.
- Each filters that will have dependencies will receive its own factory.

Any thoughts?

[] Update all the classes
[] Update tests