> $filters is just an array of Zend\Filter\FilterInterface instance (i.e.
filter chain)
> $validators is an array of instances of Zend\Validator\ValidatorInterface.

I'd argue these should be of type `Zend\Filter\FilterChain` and
`Zend\Validator\ValidatorChain`, respectively; that allows us to typehint,
and ensures consistency with the rest of the framework.


On Thu, May 16, 2013 at 12:33 PM, Artur Bodera <notifications@github.com>wrote:

> In library/Zend/Mvc/Router/Console/Simple.php:
>
> > @@ -97,9 +73,7 @@ public function __construct(
> >          $filters = null,
> >          $validators = null
> >      ) {
> > -        $this->defaults = $defaults;
> > -        $this->constraints = $constraints;
> > -        $this->aliases = $aliases;
> > +        $this->matcher = new ConsoleRouteMatcher($route, $constraints, $defaults, $aliases);
>
> Those are missing features that did not make it into "2.0 final".
>
> The best solution would be to implement those:
>
>    - $constraints should work the same<http://framework.zend.com/manual/2.0/en/modules/zend.mvc.routing.html#zend-mvc-router-http-segment>as in http
>    routes<https://github.com/zendframework/zf2/blob/master/library/Zend/Mvc/Router/Http/Segment.php#L213>- copy-paste would most likely work fine + tests.
>    - $defaults would need to be implemented in the "matcher" same as in
>    the route object.
>    - $aliases are self-explanatory.
>    - $filters is just an array of Zend\Filter\FilterInterface instance
>    (i.e. filter chain)
>    - $validators is an array of instances of
>    Zend\Validator\ValidatorInterface.
>
> Filters go through captured param values, then validators are invoked. If
> any validator fails, this equals to route mismatch (return false).
>
> This way we'd have both the BC and all features covered.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/zendframework/zf2/pull/4449/files#r4260060>
> .
>



-- 
Matthew Weier O'Phinney
matthew@weierophinney.net
http://mwop.net/