[14.x] Add size methods to the list rule builder
Merged
RI
12d ago+211+211+012345678901234567890123456789-5-5-0123456789
Follow-up to #62179, which added min(), max(), between() and exactly() to Rule::array(). This does the same for Rule::list().
Before, the size had to go on the Rule::array() builder, combined with Rule::list():
'photos' => [Rule::required(), Rule::array()->min(1), Rule::list()],
After, the same calls can be made on Rule::list() directly:
'photos' => [Rule::required(), Rule::list()->min(1)],
Rule::list() returned the string 'list', so it now returns a ListRule that casts to the same string when no methods are called. That changes the return type, which is why this targets 14.x.
ValidationRuleParser splits ListRule on |, same as ArrayRule.