/** * @return string * @throws wfWAFRuleException */ public function renderRule() { if (!$this->isActionValid()) { throw new wfWAFRuleException('Invalid action passed to ' . get_class($this) . ', action: ' . var_export($this->getAction(), true)); } $subjectExport = ''; /** @var wfWAFRuleComparisonSubject $subject */ foreach ($this->getSubjects() as $subject) { $subjectExport .= $subject->renderRule() . ", "; } $subjectExport = wfWAFUtils::substr($subjectExport, 0, -2); $expected = $this->getExpected(); return sprintf('%s(%s, %s)', $this->getAction(), $expected instanceof wfWAFRuleVariable ? $expected->renderRule() : wfWAFRule::exportString($expected), $subjectExport); }
public function renderValue() { return wfWAFRule::exportString($this); }