On 4 September 2017 07:33:41 BST, Yasuo Ohgaki <yohg...@ohgaki.net> wrote:
>Hi all,
>
>I spent a little time for a new input validation module. It's not
>totally
>new module, but is based on Filter module's validation filter
>improvement
>RFC in many ways. [1]

Hi Yasuo,

Thanks for tackling this. I do think the current filter module is user 
unfriendly and it would be great to have something better. A couple of quick 
thoughts based on your README:

- The use of nested arrays keeps things simple in one sense, but the deep 
nesting can get confusing. I wonder if a ValidationRule class would make the 
distinction between parameters and references to existing rules clearer. This 
would also give you a natural home for validating the validation rules 
themselves (probably by throwing an exception in the constructor).

- A minor point, but most style guides would suggest function names should be 
verbs, not adjectives, so "validate()" rather than "valid()".

- Is there a use case for valid_id() or is it a temporary debugging thing that 
won't be in the final version?

In general, I like the idea, but would have to play around a bit to see if it 
felt easy to use in real world situations.

Regards,

-- 
Rowan Collins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to