code: protected function saveRules()
      {
          $rules = [];
          foreach ($this->rules as $name => $rule) {
              $rules[$name] = serialize($rule);
          }
          $this->saveToFile($rules, $this->ruleFile);
      }
docs: Saves rules data into persistent storage.