code: private function generateDeclaredRules()
      {
          $rules = "array(\n";
          foreach ($this->getRules()->all() as $name => $rule) {
              $properties = array();
              $properties[] = $rule->getExpression();
              $properties[] = $rule->getTags();
  
              $rules .= sprintf("        '%s' => %s,\n", $name, str_replace("\n", '', var_export($properties, true)));
          }
          $rules .= '    )';
  
          return $rules;
      }
docs: Generates PHP code representing an array of defined rules
  together with the routes properties (e.g. requirements).
  
  @return string PHP code