extractRequestParams(); $result = AbuseFilter::evaluateExpression( $params['expression'] ); $this->getResult()->addValue( null, $this->getModuleName(), [ 'result' => $result ] ); } public function getAllowedParams() { return [ 'expression' => [ ApiBase::PARAM_REQUIRED => true, ], ]; } /** * @see ApiBase::getExamplesMessages() */ protected function getExamplesMessages() { return [ 'action=abusefilterevalexpression&expression=lcase("FOO")' => 'apihelp-abusefilterevalexpression-example-1', ]; } }