src/Util/Validator.php
public function rules(array $rules)
    {
        foreach ($rules as $ruleType => $params) {
            if (\is_array($params)) {
                foreach ($params as $innerParams) {
                    $innerParams = (array) $innerParams;
                    $this->rule($ruleType, ...$innerParams);
                }
            } else {
                $this->rule($ruleType, $params);
            }
        }

        return $this;
    }
public function rules(array $rules)
    {
        foreach ($rules as $ruleType => $params) {
            if (\is_array($params)) {
                foreach ($params as $innerParams) {
                    $innerParams = (array) $innerParams;
                    $this->rule($ruleType, ...$innerParams);
                }
            } else {
                $this->rule($ruleType, $params);
            }
        }

        return $this;
    }
public function rules ( array $ rules ) { foreach ( $ rules as $ ruleType => $ params ) { if ( \ is_array ( $ params ) ) { foreach ( $ params as $ innerParams ) { $ innerParams = ( array ) $ innerParams ; $ this -> rule ( $ ruleType , ... $ innerParams ) ; } } else { $ this -> rule ( $ ruleType , $ params ) ; } } return $ this ; }
Convenience method to add multiple validation rules with an array

@param array $rules

@return $this
@throws \InvalidArgumentException
Convenience method to add multiple validation rules with an array