src/Settings/Rules/RuleValidator.php
public function validate($rule, $value)
    {
        $arguments = $this->buildArgumentArray($rule, $value);

        $method = $this->makeRuleMethod($rule);

        if ($this->userDefinedExists($method)) {
            $class = NameResolver::makeRulesFileName();

            return call_user_func_array([$class, $method], $arguments);
        } elseif (method_exists(Rules::class, $method)) {
            return call_user_func_array([Rules::class, $method], $arguments);
        }

        throw InvalidSettingsRule::ruleNotFound($rule, $method);
    }
public function validate($rule, $value)
    {
        $arguments = $this->buildArgumentArray($rule, $value);

        $method = $this->makeRuleMethod($rule);

        if ($this->userDefinedExists($method)) {
            $class = NameResolver::makeRulesFileName();

            return call_user_func_array([$class, $method], $arguments);
        } elseif (method_exists(Rules::class, $method)) {
            return call_user_func_array([Rules::class, $method], $arguments);
        }

        throw InvalidSettingsRule::ruleNotFound($rule, $method);
    }
public function validate ( $ rule , $ value ) { $ arguments = $ this -> buildArgumentArray ( $ rule , $ value ) ; $ method = $ this -> makeRuleMethod ( $ rule ) ; if ( $ this -> userDefinedExists ( $ method ) ) { $ class = NameResolver :: makeRulesFileName ( ) ; return call_user_func_array ( [ $ class , $ method ] , $ arguments ) ; } elseif ( method_exists ( Rules :: class , $ method ) ) { return call_user_func_array ( [ Rules :: class , $ method ] , $ arguments ) ; } throw InvalidSettingsRule :: ruleNotFound ( $ rule , $ method ) ; }
Validate the value given for the rule.

@param string $rule
@param mixed  $value

@throws InvalidSettingsRule

@return bool
Validate the value given for the rule .