auraphp / Aura.Filter

Validate and sanitize arrays and objects.
MIT License
159 stars 33 forks source link

[3.x] Feature: PSR-7 upload validator #127

Closed jakejohns closed 8 years ago

jakejohns commented 8 years ago

See #118 for previous discussion.

Note:

It seems like the suggestion is to combine the 5 rules into a single rule configured by an array. That seems a little counter intuitive to me as they seem to be 'different' rules, but I'm not horrified by it as the rules are obviously related.

My concerns would be:

  • combining somewhat disparate concerns into a single class
  • more burdensome configuration, remembering the correct keys to pass
  • terse method signature (__invoke($subject, $field, $options))
  • would not this have an impact on generating useful error messages? ie. I'm not sure you can determine which part of the rule failed.

Maybe I'm off on this though. In regards to the slash in the name, I'm pretty sure that could easily be eliminated regardless of the combination approach, as that's just how the locator is configured, and could certainly just be something like uploadSizeMax or maxUploadSize

thoughts, feelings, concerns, rebuttals, remarks to alleviate my concerns?

pmjones commented 8 years ago

Nice. I reserve the right to modify after merge, but first review looks fine. Thanks!