Merge "mw.language.convertPlural: Check if matching form exists"
[lhc/web/wiklou.git] / includes / api / ApiQueryLogEvents.php
index 1a2719e..0d2f475 100644 (file)
@@ -84,7 +84,10 @@ class ApiQueryLogEvents extends ApiQueryBase {
                $this->addFieldsIf( array( 'log_id', 'page_id' ), $this->fld_ids );
                $this->addFieldsIf( array( 'log_user', 'log_user_text', 'user_name' ), $this->fld_user );
                $this->addFieldsIf( 'log_user', $this->fld_userid );
-               $this->addFieldsIf( array( 'log_namespace', 'log_title' ), $this->fld_title || $this->fld_parsedcomment );
+               $this->addFieldsIf(
+                       array( 'log_namespace', 'log_title' ),
+                       $this->fld_title || $this->fld_parsedcomment
+               );
                $this->addFieldsIf( 'log_comment', $this->fld_comment || $this->fld_parsedcomment );
                $this->addFieldsIf( 'log_params', $this->fld_details );
 
@@ -96,7 +99,8 @@ class ApiQueryLogEvents extends ApiQueryBase {
 
                if ( !is_null( $params['tag'] ) ) {
                        $this->addTables( 'change_tag' );
-                       $this->addJoinConds( array( 'change_tag' => array( 'INNER JOIN', array( 'log_id=ct_log_id' ) ) ) );
+                       $this->addJoinConds( array( 'change_tag' => array( 'INNER JOIN',
+                               array( 'log_id=ct_log_id' ) ) ) );
                        $this->addWhereFld( 'ct_tag', $params['tag'] );
                        $index['change_tag'] = 'change_tag_tag_id';
                }
@@ -110,7 +114,12 @@ class ApiQueryLogEvents extends ApiQueryBase {
                        $index['logging'] = 'type_time';
                }
 
-               $this->addTimestampWhereRange( 'log_timestamp', $params['dir'], $params['start'], $params['end'] );
+               $this->addTimestampWhereRange(
+                       'log_timestamp',
+                       $params['dir'],
+                       $params['start'],
+                       $params['end']
+               );
 
                $limit = $params['limit'];
                $this->addOption( 'LIMIT', $limit + 1 );
@@ -168,8 +177,9 @@ class ApiQueryLogEvents extends ApiQueryBase {
                $res = $this->select( __METHOD__ );
                $result = $this->getResult();
                foreach ( $res as $row ) {
-                       if ( ++ $count > $limit ) {
-                               // We've reached the one extra which shows that there are additional pages to be had. Stop here...
+                       if ( ++$count > $limit ) {
+                               // We've reached the one extra which shows that there are
+                               // additional pages to be had. Stop here...
                                $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->log_timestamp ) );
                                break;
                        }
@@ -197,7 +207,9 @@ class ApiQueryLogEvents extends ApiQueryBase {
         * @param $legacy bool
         * @return array
         */
-       public static function addLogParams( $result, &$vals, $params, $type, $action, $ts, $legacy = false ) {
+       public static function addLogParams( $result, &$vals, $params, $type,
+               $action, $ts, $legacy = false
+       ) {
                switch ( $type ) {
                        case 'move':
                                if ( $legacy ) {
@@ -285,6 +297,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
                        $result->setIndexedTagName_recursive( $logParams, 'param' );
                        $vals = array_merge( $vals, $logParams );
                }
+
                return $vals;
        }
 
@@ -392,6 +405,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
 
        public function getAllowedParams() {
                global $wgLogTypes, $wgLogActions, $wgLogActionsHandlers;
+
                return array(
                        'prop' => array(
                                ApiBase::PARAM_ISMULTI => true,
@@ -444,6 +458,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
 
        public function getParamDescription() {
                $p = $this->getModulePrefix();
+
                return array(
                        'prop' => array(
                                'Which properties to get',
@@ -473,6 +488,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
 
        public function getResultProperties() {
                global $wgLogTypes;
+
                return array(
                        'ids' => array(
                                'logid' => 'integer',