code: public function updateRule($name, $rule)
      {
          if ($rule->name !== $name) {
              unset($this->rules[$name]);
          }
          $this->rules[$rule->name] = $rule;
          $this->saveRules();
          return true;
      }
docs: {@inheritdoc}