Sets the rule-sets.

@param array|string $ruleSetFileNames
Array of rule-set filenames or identifiers.

@return $this
505272
public function rulesets($ruleSetFileNames)
    {
        if (!is_array($ruleSetFileNames)) {
            $ruleSetFileNames = [$ruleSetFileNames];
        }
        $this->rulesets = array_unique(array_merge($this->rulesets, $ruleSetFileNames));

        return $this;
    }
373311
public function setFiles(array $files)
    {
        foreach ($files as $file) {
            if (is_file($file)) {
                $file = new SplFileInfo($file, $file, $file);
            }

            if (!($file instanceof SplFileInfo)) {
                throw new InvalidArgumentException("File $file not exists.");
            }

            $this->files[$file->getRealPath()] = $file;
        }

        return $this;
    }
1087251
public function setValidationRules($validationRules)
    {
        if (! is_array($validationRules)) {
            $validationRules = func_get_args();
        }

        $this->validationRules = [];
        foreach ($validationRules as $rule) {
            if ($rule instanceof \Illuminate\Validation\Rule || $rule instanceof \Illuminate\Contracts\Validation\Rule || $rule instanceof Dimensions || $rule instanceof Exists || $rule instanceof In || $rule instanceof NotIn || $rule instanceof Unique) {
                $this->addValidationRule($rule);
            } else {
                $rules = explode('|', $rule);
                foreach ($rules as $addRule) {
                    $this->addValidationRule($addRule);
                }
            }
        }

        return $this;
    }
981917
public function setRules(array $rules)
    {
        $this->rules = [];
        foreach ($rules as $key => $value) {
            if (is_int($key)) {
                $routeRegex  = $value;
                $permissions = [];
            } else {
                $routeRegex  = $key;
                $permissions = (array) $value;
            }
            $this->rules[$routeRegex] = $permissions;
        }
    }
1189930
public function addRules(array $rules, $ruleset = null)
    {
        if ($ruleset) {
            $newRules = array_merge($this->getRuleset($ruleset), $rules);
            $this->setRuleset($newRules, $ruleset);
        } else {
            $newRules = array_merge($this->getRules(), $rules);
            $this->setRules($newRules);
        }
    }
442841
public function setPictureUploadRules($rules)
    {
        $this->_pictureUploadRules = [];
        if (!is_array($rules)) {
            return;
        }
        foreach ($rules as $rule) {
            $this->_pictureUploadRules[] = array_merge(['picture'], $rule);
        }
    }
73993
public function setPatterns($patterns)
    {
        foreach ($patterns as $name => $pattern) {
            $this->setPattern($name, $pattern);
        }

        return $this;
    }
953179
public function set(array $files)
    {
        if (!empty($files)) {
            foreach ($files as $_file) {
                if (is_array($_file) && isset($_file['file'])) {
                    $this->add(
                        $_file['file'],
                        isset($_file['media']) ? $_file['media'] : '',
                        isset($_file['condition']) ? $_file['condition'] : null
                    );
                } elseif (is_string($_file)) {
                    $this->add($_file);
                }
            }
        }
        return $this;
    }
408645
public function setFiles(array $files) {
        if(!$this->setModified('files', $files)->isModified()) {
            return $this;
        }
		$this->files = $files;
		return $this;
    }
152158
protected function hasRule(array $keyRules, $ruleNames)
    {

        $ruleNames = (array)$ruleNames;

        foreach ($keyRules as $ruleName=>$parameters) {
            if (in_array($ruleName, $ruleNames)) {
                return true;
            }
        }

        return false;
    }
1142649
public function addMultiple($rules)
    {
        foreach ($rules as $singleRule) {
            // make sure the rule is an array (the parameters of subsequent calls);
            $singleRule = is_array($singleRule) ? $singleRule : array(
                $singleRule
            );
            call_user_func_array(
                array(
                    $this,
                    'add'
                ),
                $singleRule
            );
        }

        return $this;
    }
294277
public function setRules($fieldNameOrArray, $rules = [])
    {
        // Determine Parameter Mode:
        
        if (is_array($fieldNameOrArray)) {
            
            // Define All Rules:
            
            foreach ($fieldNameOrArray as $fieldName => $rules) {
                $this->setRules($fieldName, $rules);
            }
            
        } else {
            
            // Define Rules for Specified Field:
            
            foreach ($rules as $rule) {
                $this->setRule($fieldNameOrArray, $rule);
            }
            
        }
        
        // Answer Self:
        
        return $this;
    }
1159886
public function offsetSet($field, $rules)
    {
        if (!$rules instanceof ValidationSet) {
            $set = new ValidationSet();
            foreach ((array)$rules as $name => $rule) {
                $set->add($name, $rule);
            }
        }
        $this->_fields[$field] = $rules;
    }
296691
public void setRuleSets(java.util.Collection<MatchmakingRuleSet> ruleSets) {
        if (ruleSets == null) {
            this.ruleSets = null;
            return;
        }

        this.ruleSets = new java.util.ArrayList<MatchmakingRuleSet>(ruleSets);
    }
960899
public function rules($rules)
    {
        foreach ($rules as $rule => $field) {
            if (is_array($field) && is_array($field[0])) {
                foreach ($field as $params) {
                    array_unshift($params, $rule);
                    call_user_func_array([$this, 'rule'], $params);
                }
            } else {
                $this->rule($rule, $field);
            }
        }
        return $this;
    }
741564
public function setRules($rules = [], $operation = null)
    {
        $rulesProperty = $operation ? $operation.'Rules' : 'rules';

        $this->{$rulesProperty} = $rules;

        return $this;
    }
1302282
public function addRules($rules)
    {
        if ($rules instanceof RiskyRulesAwareInterface && $rules->isRisky()) {
            $this->setRiskyAllowed(true);
        }

        if ($rules instanceof \Traversable) {
            $rules = iterator_to_array($rules);
        }

        if (!is_array($rules)) {
            throw new \InvalidArgumentException('Expected rules to be an iterable.');
        }

        $rules = array_replace($this->getRules(), $rules);

        $this->setRules($rules);

        return $this;
    }