Closed alextartan closed 6 years ago
@alextartan
I'm guessing Regex should accept array as well
It accepts also an array
. Only the DocBlock is missing this hint.
@froschdesign I know. I made this Pull Request to fix the docblock https://github.com/zendframework/zend-validator/pull/198
@froschdesign any news on this?
as #198 merged, it can be closed.
The current docblock lists
@param string|Traversable $pattern
, but arrays are accepted as well.What should it receive to avoid any warnings?
I'm currently using:
But it seems a bit of an overhead to wrap an array in an arrayIterator just to avoid a warning. I can. of course, extend the
Regex
validator and fix this in my codebase, but i figure i'm not the only one bumping into this isuue.Since the
$pattern
parameter is passed toparent::__construct($param)
which does accept@param array|Traversable $options
, I'm guessingRegex
should acceptarray
as well