Add Rule
@param string $rule
@param string $action
@param string $method
@return bool
760749
public function addRule($rule = '', $action = '', $method = RouteMethod::ANY)
    {
        $method = empty($method) ? RouteMethod::ANY : strtolower($method);
        if (!isset($this->rule[$method])) {
            $this->rule[$method] = array();
        }
        $this->rule[$method][$rule] = $action;
        return true;
    }
1101211
function addRules(rules) {
        _.each(rules, function (rule) {
            _global.rules[rule.id] = rule;
        });
    }
1247451
public function addLexerRule($rulename, $rule)
	{
		$this->rules[$rulename] = [];
		$this->rules[$rulename][] = $rule; 
	}
1232886
private function addCallback(string $method, $state) : void
    {
        $state = $this->makeCallable($state);
        $this->actions[$method] = $state;
    }
838375
public function match($methods, $uri, $action)
    {
        return $this->addRoute(\array_map('strtoupper', (array) $methods), $uri, $action);
    }
314654
def add_rule(rule)
      if rule.is_a? Axlsx::ConditionalFormattingRule
        @rules << rule
      elsif rule.is_a? Hash
        @rules << ConditionalFormattingRule.new(rule)
      end
    end
922111
public function addAction(string $action): ClassDeclaration\MethodDeclaration
    {
        $method = $this->method($action . $this->actionPostfix);

        return $method->setAccess(ClassDeclaration\MethodDeclaration::ACCESS_PROTECTED);
    }
521200
public static function AppendRule ($rule_name, $rule) {
		$rule_list = static::GetValidateRuleList();
		$rule_list[$rule_name] = $rule;
		static::SetClassVar('_rule', $rule_list);
	}
490757
public function addRules($rules, $method = '*', $option = [], $pattern = [])
    {
        foreach ($rules as $key => $val) {
            if (is_numeric($key)) {
                $key = array_shift($val);
            }

            if (is_array($val)) {
                $route = array_shift($val);
                $option = $val ? array_shift($val) : [];
                $pattern = $val ? array_shift($val) : [];
            } else {
                $route = $val;
            }

            $this->addRule($key, $route, $method, $option, $pattern);
        }
    }
649831
public function add($type, $rule, $action, $options = null) {
		$add = [];
		if (strpos($rule, '{') !== false) {
			$param = [];
			$regex = str_replace('/', '\\/', $rule);
			$regex = preg_replace_callback('/\{([a-zA-Z0-9_]+)\}/', function($matches) use (&$param, &$options) {
				$paramName = $matches[1];
				$param[] = $paramName;
				if (is_array($options) && isset($options[$paramName])) {
					return $options[$paramName];
				} else {
					return '([^\/]+)';
				}
			}, $regex);
			$regex = '/^' . $regex . '$/';
			$add['regex'] = $regex;
			$add['param'] = $param;
		} else {
			$add['uri'] = $rule;
		}
		if (!isset($this->routes[$type])) {
			$this->routes[$type] = [];
		}
		if (is_string($action)) {
			$res = explode('.', $action, 3);
			if (count($res) === 3) {
				$add['dispatch'] = [
					'module' => $res[0],
					'controller' => $res[1],
					'action' => $res[2]
				];
			} else {
				$add['dispatch'] = [
					'controller' => $res[0],
					'action' => $res[1]
				];
			}
		} else {
			$add['dispatch'] = $action;
		}
		$this->routes[$type][] = $add;
	}
215283
protected function addRecord($entity, array $action = [])
    {
        if ($entity instanceof $this->className) {
            if (false !== ($index = array_search($entity, array_column($this->records, 0), true))) {
                if (!in_array($this->records[$index], $action)) {
                    $this->records[$index][] = $action;
                }
            } else {
                $this->records[] = [$entity, $action];
            }
        }
    }
1268737
protected function applyRule(MethodNode $method)
    {
        if ($method->getName() !== '__construct') {
            return;
        }

        $params = $method->getParameters();
        if (count($params) === 1) {
            return;
        }

        $message = sprintf(
            'The %s is having %s parameters which violates the rule "%s"',
            count($params),
            $method->getFullQualifiedName(),
            static::RULE
        );

        $this->addViolation($method, [$message]);
    }
224138
public function setCrossDomainRule($rule, $method = '*')
    {
        if (!isset($this->cross)) {
            $this->cross = (new RuleGroup($this))->mergeRuleRegex($this->mergeRuleRegex);
        }

        $this->cross->addRuleItem($rule, $method);

        return $this;
    }
1315979
public function addRule(Rule $rule)
    {
        $this->addReason($rule->getId(), array(
            'rule' => $rule,
            'job' => $rule->getJob(),
        ));
    }
919034
public final function addRule($field, array $rules, $multiple = false) {
		foreach ($rules as $rule => $m) {
			if (is_array($m)) {
				@list($r, $ops, $m, $multiple) = $m;
			} else {
				if (is_int($rule)) {
					$rule = $m;
					list($r, $ops) = $this->parseRule($rule);
					$m = '';
				} else {
					list($r, $ops) = $this->parseRule($rule);
				}
			}
			if ($r) {
				$this->rulesIdx[ $field ]       += 1;
				$idx                            = $this->rulesIdx[ $field ];
				$this->rules[ $field ][ $idx ]  = [$r, $ops, $m, $multiple];
				$this->ruleKeys[ $field ][ $r ] = $idx;
			}
		}
	}
437576
public function add(FilterRule $rule)
    {
        $this->rules[$rule->getName()] = $rule;

        if (!\is_null($rule->getValue())) {
            $this->hasDefaults = true;
        }

        return $this;
    }
764348
public function add($view, RuleCollection $collection)
    {
        $name = FormHelper::getFormName($view);
        if (isset($this->rules[$name])) {
            $this->rules[$name]->addCollection($collection);
        } else {
            $this->rules[$name] = $collection;
        }
    }