zendframework/zf2 — pull request #4148 by leup (2013-03-30 10:45:47+00:00)
Title: Filters priority setting when populate filters in inputfilter factory and not losing it when merging filter chains

This PR do thwo things.

First, we can set the filter priority in the configuration array when creating an input filter through factory.

```
$input->add($factory->createInput(array(
'name' => 'img_background',
'required' => true
'filters' => array(
array(
'name' => 'Admin\Filter\Diacritics',
'priority' => 10000
),
),
)));
```

It works also for filters set within the form element, here:
```
class Image extends \Zend\Form\File
{
public function getInputSpecification() {
$specs = parent::getInputSpecification();
if (!isset($specs['filters']) || !is_array($specs['filters'])) {
$specs['filters'] = array();
}
$specs['filters'][] = array(
'name' => '\Admin\Filter\Thumbnail',
'priority' => 999
);

return $specs;
}
}
```

Second, when merging two filter chains, the filters priority of the merged filter chain are no more lost in the process (reset to the default_priority constant which is 1000 for now).

Keeping my examples above if this two filter chains were related to the same form element then they would be merged and the filters priority of the merged filter chain would be lost (in my example, the merged one is the one with the Diacritics Filter).

With this PR the priority of the Diacritics filter would not be lost when the two filter chains would be merged.

PS: I wanted to make some unit tests but the truth is I don't even know where to start, I'm not even sure it is needed.