auraphp / Aura.Filter

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

Closure filtering should allow any callable instead #71

Closed auroraeosrose closed 9 years ago

auroraeosrose commented 9 years ago

The closure filtering is typehinting using Closure, this means that callable methods or functions from elsewhere cannot be used

Using the Callable typehint instead (available since 5.4) would allow any legal callable to be used instead (and would require no code changes except the typehint)

harikt commented 9 years ago

@auroraeosrose I hope you are using the 2.x branch ? .

auroraeosrose commented 9 years ago

yes

harikt commented 9 years ago

May be you could send a PR, so Paul could look and merge.

Thank you.

pmjones commented 9 years ago

Good call. Would we be ok renaming the classes from (Sanitize|Validate)\Closure to `(Sanitize|Validate)\Callback in line with that change?

pmjones commented 9 years ago

@auroraeosrose ^

auroraeosrose commented 9 years ago

callback or callable? ah naming things - doesn't matter too much

pmjones commented 9 years ago

Callable is reserved, so callback. I take that to mean a rename in general is not a problem.