Merge "Remove unnecessary, unoptimized, unused overview SVG"
[lhc/web/wiklou.git] / includes / api / ApiQueryLogEvents.php
index 39be2c1..3cb55e4 100644 (file)
@@ -263,32 +263,6 @@ class ApiQueryLogEvents extends ApiQueryBase {
                $result->addIndexedTagName( [ 'query', $this->getModuleName() ], 'item' );
        }
 
-       /**
-        * @deprecated since 1.25 Use LogFormatter::formatParametersForApi instead
-        * @param ApiResult $result
-        * @param array &$vals
-        * @param string $params
-        * @param string $type
-        * @param string $action
-        * @param string $ts
-        * @param bool $legacy
-        * @return array
-        */
-       public static function addLogParams( $result, &$vals, $params, $type,
-               $action, $ts, $legacy = false
-       ) {
-               wfDeprecated( __METHOD__, '1.25' );
-
-               $entry = new ManualLogEntry( $type, $action );
-               $entry->setParameters( $params );
-               $entry->setTimestamp( $ts );
-               $entry->setLegacy( $legacy );
-               $formatter = LogFormatter::newFromEntry( $entry );
-               $vals['params'] = $formatter->formatParametersForApi();
-
-               return $vals;
-       }
-
        private function extractRowInfo( $row ) {
                $logEntry = DatabaseLogEntry::newFromRow( $row );
                $vals = [
@@ -414,6 +388,12 @@ class ApiQueryLogEvents extends ApiQueryBase {
 
        public function getAllowedParams( $flags = 0 ) {
                $config = $this->getConfig();
+               if ( $flags & ApiBase::GET_VALUES_FOR_HELP ) {
+                       $logActions = $this->getAllowedLogActions();
+                       sort( $logActions );
+               } else {
+                       $logActions = null;
+               }
                $ret = [
                        'prop' => [
                                ApiBase::PARAM_ISMULTI => true,
@@ -437,9 +417,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
                        ],
                        'action' => [
                                // validation on request is done in execute()
-                               ApiBase::PARAM_TYPE => ( $flags & ApiBase::GET_VALUES_FOR_HELP )
-                                       ? $this->getAllowedLogActions()
-                                       : null
+                               ApiBase::PARAM_TYPE => $logActions
                        ],
                        'start' => [
                                ApiBase::PARAM_TYPE => 'timestamp'