private function addRule($type, Rule $newRule = null)
    {
        if (!$newRule || $this->rules->containsEqual($newRule)) {
            return;
        }

        $this->rules->add($newRule, $type);
    }