cakephp/cakephp

RulesChecker::remove()

PaulHendriks opened this issue · 4 comments

Description

The Validator provides a remove() method to remove existing rule(s), the RulesChecker however, does not.
If i extend a Table and want to use it's rules, except for one, i'd have to copy/paste the rules i want, omitting the one i don't want, or the one i want to change.

I'd rather not duplicate code, if the rules of the parent change some time in the future, these changes will be lost to the child.

CakePHP Version

No response

Many rules are attached as Closure instances. How would you want to remove those?

I was hoping the rules worked like a collection, that you could remove one (or more) afterwards.

I guess they would need to be assoc for that.

Pr open.