stylize.php on API code
[lhc/web/wiklou.git] / includes / api / ApiQueryRecentChanges.php
index 5b292e2..d90fa3a 100644 (file)
@@ -23,9 +23,9 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-if (!defined('MEDIAWIKI')) {
+if ( !defined( 'MEDIAWIKI' ) ) {
        // Eclipse helper - will be ignored in production
-       require_once ('ApiQueryBase.php');
+       require_once ( 'ApiQueryBase.php' );
 }
 
 /**
@@ -36,8 +36,8 @@ if (!defined('MEDIAWIKI')) {
  */
 class ApiQueryRecentChanges extends ApiQueryBase {
 
-       public function __construct($query, $moduleName) {
-               parent :: __construct($query, $moduleName, 'rc');
+       public function __construct( $query, $moduleName ) {
+               parent :: __construct( $query, $moduleName, 'rc' );
        }
 
        private $fld_comment = false, $fld_user = false, $fld_flags = false,
@@ -51,30 +51,30 @@ class ApiQueryRecentChanges extends ApiQueryBase {
         */
        protected function getTokenFunctions() {
                // Don't call the hooks twice
-               if(isset($this->tokenFunctions))
+               if ( isset( $this->tokenFunctions ) )
                        return $this->tokenFunctions;
 
                // If we're in JSON callback mode, no tokens can be obtained
-               if(!is_null($this->getMain()->getRequest()->getVal('callback')))
+               if ( !is_null( $this->getMain()->getRequest()->getVal( 'callback' ) ) )
                        return array();
 
                $this->tokenFunctions = array(
                        'patrol' => array( 'ApiQueryRecentChanges', 'getPatrolToken' )
                );
-               wfRunHooks('APIQueryRecentChangesTokens', array(&$this->tokenFunctions));
+               wfRunHooks( 'APIQueryRecentChangesTokens', array( &$this->tokenFunctions ) );
                return $this->tokenFunctions;
        }
        
-       public static function getPatrolToken($pageid, $title, $rc)
+       public static function getPatrolToken( $pageid, $title, $rc )
        {
                global $wgUser;
-               if(!$wgUser->useRCPatrol() && (!$wgUser->useNPPatrol() ||
-                                $rc->getAttribute('rc_type') != RC_NEW))
+               if ( !$wgUser->useRCPatrol() && ( !$wgUser->useNPPatrol() ||
+                                $rc->getAttribute( 'rc_type' ) != RC_NEW ) )
                        return false;
                
                // The patrol token is always the same, let's exploit that
                static $cachedPatrolToken = null;
-               if(!is_null($cachedPatrolToken))
+               if ( !is_null( $cachedPatrolToken ) )
                        return $cachedPatrolToken;
 
                $cachedPatrolToken = $wgUser->editToken();
@@ -86,17 +86,17 @@ class ApiQueryRecentChanges extends ApiQueryBase {
         * @param $prop associative array of properties, only keys are used here
         */
        public function initProperties( $prop ) {
-               $this->fld_comment = isset ($prop['comment']);
-               $this->fld_user = isset ($prop['user']);
-               $this->fld_flags = isset ($prop['flags']);
-               $this->fld_timestamp = isset ($prop['timestamp']);
-               $this->fld_title = isset ($prop['title']);
-               $this->fld_ids = isset ($prop['ids']);
-               $this->fld_sizes = isset ($prop['sizes']);
-               $this->fld_redirect = isset($prop['redirect']);
-               $this->fld_patrolled = isset($prop['patrolled']);
-               $this->fld_loginfo = isset($prop['loginfo']);
-               $this->fld_tags = isset($prop['tags']);
+               $this->fld_comment = isset ( $prop['comment'] );
+               $this->fld_user = isset ( $prop['user'] );
+               $this->fld_flags = isset ( $prop['flags'] );
+               $this->fld_timestamp = isset ( $prop['timestamp'] );
+               $this->fld_title = isset ( $prop['title'] );
+               $this->fld_ids = isset ( $prop['ids'] );
+               $this->fld_sizes = isset ( $prop['sizes'] );
+               $this->fld_redirect = isset( $prop['redirect'] );
+               $this->fld_patrolled = isset( $prop['patrolled'] );
+               $this->fld_loginfo = isset( $prop['loginfo'] );
+               $this->fld_tags = isset( $prop['tags'] );
        }
 
        /**
@@ -112,62 +112,62 @@ class ApiQueryRecentChanges extends ApiQueryBase {
                 *              AND rc_deleted = '0'
                 */
                $db = $this->getDB();
-               $this->addTables('recentchanges');
+               $this->addTables( 'recentchanges' );
                $index = 'rc_timestamp'; // May change
-               $this->addWhereRange('rc_timestamp', $params['dir'], $params['start'], $params['end']);
-               $this->addWhereFld('rc_namespace', $params['namespace']);
-               $this->addWhereFld('rc_deleted', 0);
+               $this->addWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
+               $this->addWhereFld( 'rc_namespace', $params['namespace'] );
+               $this->addWhereFld( 'rc_deleted', 0 );
 
-               if(!is_null($params['type']))
-                               $this->addWhereFld('rc_type', $this->parseRCType($params['type']));
+               if ( !is_null( $params['type'] ) )
+                               $this->addWhereFld( 'rc_type', $this->parseRCType( $params['type'] ) );
 
-               if (!is_null($params['show'])) {
-                       $show = array_flip($params['show']);
+               if ( !is_null( $params['show'] ) ) {
+                       $show = array_flip( $params['show'] );
 
                        /* Check for conflicting parameters. */
-                       if ((isset ($show['minor']) && isset ($show['!minor']))
-                                       || (isset ($show['bot']) && isset ($show['!bot']))
-                                       || (isset ($show['anon']) && isset ($show['!anon']))
-                                       || (isset ($show['redirect']) && isset ($show['!redirect']))
-                                       || (isset ($show['patrolled']) && isset ($show['!patrolled']))) {
+                       if ( ( isset ( $show['minor'] ) && isset ( $show['!minor'] ) )
+                                       || ( isset ( $show['bot'] ) && isset ( $show['!bot'] ) )
+                                       || ( isset ( $show['anon'] ) && isset ( $show['!anon'] ) )
+                                       || ( isset ( $show['redirect'] ) && isset ( $show['!redirect'] ) )
+                                       || ( isset ( $show['patrolled'] ) && isset ( $show['!patrolled'] ) ) ) {
 
-                               $this->dieUsage("Incorrect parameter - mutually exclusive values may not be supplied", 'show');
+                               $this->dieUsage( "Incorrect parameter - mutually exclusive values may not be supplied", 'show' );
                        }
                        
                        // Check permissions
                        global $wgUser;
-                       if((isset($show['patrolled']) || isset($show['!patrolled'])) && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol())
-                               $this->dieUsage("You need the patrol right to request the patrolled flag", 'permissiondenied');
+                       if ( ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ) && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() )
+                               $this->dieUsage( "You need the patrol right to request the patrolled flag", 'permissiondenied' );
 
                        /* Add additional conditions to query depending upon parameters. */
-                       $this->addWhereIf('rc_minor = 0', isset ($show['!minor']));
-                       $this->addWhereIf('rc_minor != 0', isset ($show['minor']));
-                       $this->addWhereIf('rc_bot = 0', isset ($show['!bot']));
-                       $this->addWhereIf('rc_bot != 0', isset ($show['bot']));
-                       $this->addWhereIf('rc_user = 0', isset ($show['anon']));
-                       $this->addWhereIf('rc_user != 0', isset ($show['!anon']));
-                       $this->addWhereIf('rc_patrolled = 0', isset($show['!patrolled']));
-                       $this->addWhereIf('rc_patrolled != 0', isset($show['patrolled']));
-                       $this->addWhereIf('page_is_redirect = 1', isset ($show['redirect']));
+                       $this->addWhereIf( 'rc_minor = 0', isset ( $show['!minor'] ) );
+                       $this->addWhereIf( 'rc_minor != 0', isset ( $show['minor'] ) );
+                       $this->addWhereIf( 'rc_bot = 0', isset ( $show['!bot'] ) );
+                       $this->addWhereIf( 'rc_bot != 0', isset ( $show['bot'] ) );
+                       $this->addWhereIf( 'rc_user = 0', isset ( $show['anon'] ) );
+                       $this->addWhereIf( 'rc_user != 0', isset ( $show['!anon'] ) );
+                       $this->addWhereIf( 'rc_patrolled = 0', isset( $show['!patrolled'] ) );
+                       $this->addWhereIf( 'rc_patrolled != 0', isset( $show['patrolled'] ) );
+                       $this->addWhereIf( 'page_is_redirect = 1', isset ( $show['redirect'] ) );
                        // Don't throw log entries out the window here
-                       $this->addWhereIf('page_is_redirect = 0 OR page_is_redirect IS NULL', isset ($show['!redirect']));
+                       $this->addWhereIf( 'page_is_redirect = 0 OR page_is_redirect IS NULL', isset ( $show['!redirect'] ) );
                }
                
-               if(!is_null($params['user']) && !is_null($param['excludeuser']))
-                       $this->dieUsage('user and excludeuser cannot be used together', 'user-excludeuser');
-               if(!is_null($params['user']))
+               if ( !is_null( $params['user'] ) && !is_null( $param['excludeuser'] ) )
+                       $this->dieUsage( 'user and excludeuser cannot be used together', 'user-excludeuser' );
+               if ( !is_null( $params['user'] ) )
                {
-                       $this->addWhereFld('rc_user_text', $params['user']);
+                       $this->addWhereFld( 'rc_user_text', $params['user'] );
                        $index = 'rc_user_text';
                }
-               if(!is_null($params['excludeuser']))
+               if ( !is_null( $params['excludeuser'] ) )
                        // We don't use the rc_user_text index here because
                        // * it would require us to sort by rc_user_text before rc_timestamp
                        // * the != condition doesn't throw out too many rows anyway
-                       $this->addWhere('rc_user_text != ' . $this->getDB()->addQuotes($params['excludeuser']));
+                       $this->addWhere( 'rc_user_text != ' . $this->getDB()->addQuotes( $params['excludeuser'] ) );
 
                /* Add the fields we're concerned with to our query. */
-               $this->addFields(array (
+               $this->addFields( array (
                        'rc_timestamp',
                        'rc_namespace',
                        'rc_title',
@@ -175,90 +175,90 @@ class ApiQueryRecentChanges extends ApiQueryBase {
                        'rc_type',
                        'rc_moved_to_ns',
                        'rc_moved_to_title'
-               ));
+               ) );
 
                /* Determine what properties we need to display. */
-               if (!is_null($params['prop'])) {
-                       $prop = array_flip($params['prop']);
+               if ( !is_null( $params['prop'] ) ) {
+                       $prop = array_flip( $params['prop'] );
 
                        /* Set up internal members based upon params. */
                        $this->initProperties( $prop );
 
                        global $wgUser;
-                       if($this->fld_patrolled && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol())
-                               $this->dieUsage("You need the patrol right to request the patrolled flag", 'permissiondenied');
+                       if ( $this->fld_patrolled && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() )
+                               $this->dieUsage( "You need the patrol right to request the patrolled flag", 'permissiondenied' );
 
                        /* Add fields to our query if they are specified as a needed parameter. */
-                       $this->addFieldsIf('rc_id', $this->fld_ids);
-                       $this->addFieldsIf('rc_this_oldid', $this->fld_ids);
-                       $this->addFieldsIf('rc_last_oldid', $this->fld_ids);
-                       $this->addFieldsIf('rc_comment', $this->fld_comment);
-                       $this->addFieldsIf('rc_user', $this->fld_user);
-                       $this->addFieldsIf('rc_user_text', $this->fld_user);
-                       $this->addFieldsIf('rc_minor', $this->fld_flags);
-                       $this->addFieldsIf('rc_bot', $this->fld_flags);
-                       $this->addFieldsIf('rc_new', $this->fld_flags);
-                       $this->addFieldsIf('rc_old_len', $this->fld_sizes);
-                       $this->addFieldsIf('rc_new_len', $this->fld_sizes);
-                       $this->addFieldsIf('rc_patrolled', $this->fld_patrolled);
-                       $this->addFieldsIf('rc_logid', $this->fld_loginfo);
-                       $this->addFieldsIf('rc_log_type', $this->fld_loginfo);
-                       $this->addFieldsIf('rc_log_action', $this->fld_loginfo);
-                       $this->addFieldsIf('rc_params', $this->fld_loginfo);
-                       if($this->fld_redirect || isset($show['redirect']) || isset($show['!redirect']))
+                       $this->addFieldsIf( 'rc_id', $this->fld_ids );
+                       $this->addFieldsIf( 'rc_this_oldid', $this->fld_ids );
+                       $this->addFieldsIf( 'rc_last_oldid', $this->fld_ids );
+                       $this->addFieldsIf( 'rc_comment', $this->fld_comment );
+                       $this->addFieldsIf( 'rc_user', $this->fld_user );
+                       $this->addFieldsIf( 'rc_user_text', $this->fld_user );
+                       $this->addFieldsIf( 'rc_minor', $this->fld_flags );
+                       $this->addFieldsIf( 'rc_bot', $this->fld_flags );
+                       $this->addFieldsIf( 'rc_new', $this->fld_flags );
+                       $this->addFieldsIf( 'rc_old_len', $this->fld_sizes );
+                       $this->addFieldsIf( 'rc_new_len', $this->fld_sizes );
+                       $this->addFieldsIf( 'rc_patrolled', $this->fld_patrolled );
+                       $this->addFieldsIf( 'rc_logid', $this->fld_loginfo );
+                       $this->addFieldsIf( 'rc_log_type', $this->fld_loginfo );
+                       $this->addFieldsIf( 'rc_log_action', $this->fld_loginfo );
+                       $this->addFieldsIf( 'rc_params', $this->fld_loginfo );
+                       if ( $this->fld_redirect || isset( $show['redirect'] ) || isset( $show['!redirect'] ) )
                        {
-                               $this->addTables('page');
-                               $this->addJoinConds(array('page' => array('LEFT JOIN', array('rc_namespace=page_namespace', 'rc_title=page_title'))));
-                               $this->addFields('page_is_redirect');
+                               $this->addTables( 'page' );
+                               $this->addJoinConds( array( 'page' => array( 'LEFT JOIN', array( 'rc_namespace=page_namespace', 'rc_title=page_title' ) ) ) );
+                               $this->addFields( 'page_is_redirect' );
                        }
                }
                
-               if($this->fld_tags) {
-                       $this->addTables('tag_summary');
-                       $this->addJoinConds(array('tag_summary' => array('LEFT JOIN', array('rc_id=ts_rc_id'))));
-                       $this->addFields('ts_tags');
+               if ( $this->fld_tags ) {
+                       $this->addTables( 'tag_summary' );
+                       $this->addJoinConds( array( 'tag_summary' => array( 'LEFT JOIN', array( 'rc_id=ts_rc_id' ) ) ) );
+                       $this->addFields( 'ts_tags' );
                }
                        
-               if(!is_null($params['tag'])) {
-                       $this->addTables('change_tag');
-                       $this->addJoinConds(array('change_tag' => array('INNER JOIN', array('rc_id=ct_rc_id'))));
-                       $this->addWhereFld('ct_tag' , $params['tag']);
+               if ( !is_null( $params['tag'] ) ) {
+                       $this->addTables( 'change_tag' );
+                       $this->addJoinConds( array( 'change_tag' => array( 'INNER JOIN', array( 'rc_id=ct_rc_id' ) ) ) );
+                       $this->addWhereFld( 'ct_tag' , $params['tag'] );
                }
                $this->token = $params['token'];
-               $this->addOption('LIMIT', $params['limit'] +1);
-               $this->addOption('USE INDEX', array('recentchanges' => $index));
+               $this->addOption( 'LIMIT', $params['limit'] + 1 );
+               $this->addOption( 'USE INDEX', array( 'recentchanges' => $index ) );
 
                $count = 0;
                /* Perform the actual query. */
                $db = $this->getDB();
-               $res = $this->select(__METHOD__);
+               $res = $this->select( __METHOD__ );
 
                /* Iterate through the rows, adding data extracted from them to our query result. */
-               while ($row = $db->fetchObject($res)) {
-                       if (++ $count > $params['limit']) {
+               while ( $row = $db->fetchObject( $res ) ) {
+                       if ( ++ $count > $params['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->rc_timestamp));
+                               $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) );
                                break;
                        }
 
                        /* Extract the data from a single row. */
-                       $vals = $this->extractRowInfo($row);
+                       $vals = $this->extractRowInfo( $row );
 
                        /* Add that row's data to our final output. */
-                       if(!$vals)
+                       if ( !$vals )
                                continue;
-                       $fit = $this->getResult()->addValue(array('query', $this->getModuleName()), null, $vals);
-                       if(!$fit)
+                       $fit = $this->getResult()->addValue( array( 'query', $this->getModuleName() ), null, $vals );
+                       if ( !$fit )
                        {
-                               $this->setContinueEnumParameter('start', wfTimestamp(TS_ISO_8601, $row->rc_timestamp));
+                               $this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->rc_timestamp ) );
                                break;
                        }
                }
 
-               $db->freeResult($res);
+               $db->freeResult( $res );
 
                /* Format the result */
-               $this->getResult()->setIndexedTagName_internal(array('query', $this->getModuleName()), 'rc');
+               $this->getResult()->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'rc' );
        }
 
        /**
@@ -268,14 +268,14 @@ class ApiQueryRecentChanges extends ApiQueryBase {
         * @return An array mapping strings (descriptors) to their respective string values.
         * @access public
         */
-       public function extractRowInfo($row) {
+       public function extractRowInfo( $row ) {
                /* If page was moved somewhere, get the title of the move target. */
                $movedToTitle = false;
-               if (isset($row->rc_moved_to_title) && $row->rc_moved_to_title !== '')
-                       $movedToTitle = Title :: makeTitle($row->rc_moved_to_ns, $row->rc_moved_to_title);
+               if ( isset( $row->rc_moved_to_title ) && $row->rc_moved_to_title !== '' )
+                       $movedToTitle = Title :: makeTitle( $row->rc_moved_to_ns, $row->rc_moved_to_title );
 
                /* Determine the title of the page that has been changed. */
-               $title = Title :: makeTitle($row->rc_namespace, $row->rc_title);
+               $title = Title :: makeTitle( $row->rc_namespace, $row->rc_title );
 
                /* Our output data. */
                $vals = array ();
@@ -293,88 +293,88 @@ class ApiQueryRecentChanges extends ApiQueryBase {
                }
 
                /* Create a new entry in the result for the title. */
-               if ($this->fld_title) {
-                       ApiQueryBase :: addTitleInfo($vals, $title);
-                       if ($movedToTitle)
-                               ApiQueryBase :: addTitleInfo($vals, $movedToTitle, "new_");
+               if ( $this->fld_title ) {
+                       ApiQueryBase :: addTitleInfo( $vals, $title );
+                       if ( $movedToTitle )
+                               ApiQueryBase :: addTitleInfo( $vals, $movedToTitle, "new_" );
                }
 
                /* Add ids, such as rcid, pageid, revid, and oldid to the change's info. */
-               if ($this->fld_ids) {
-                       $vals['rcid'] = intval($row->rc_id);
-                       $vals['pageid'] = intval($row->rc_cur_id);
-                       $vals['revid'] = intval($row->rc_this_oldid);
+               if ( $this->fld_ids ) {
+                       $vals['rcid'] = intval( $row->rc_id );
+                       $vals['pageid'] = intval( $row->rc_cur_id );
+                       $vals['revid'] = intval( $row->rc_this_oldid );
                        $vals['old_revid'] = intval( $row->rc_last_oldid );
                }
 
                /* Add user data and 'anon' flag, if use is anonymous. */
-               if ($this->fld_user) {
+               if ( $this->fld_user ) {
                        $vals['user'] = $row->rc_user_text;
-                       if(!$row->rc_user)
+                       if ( !$row->rc_user )
                                $vals['anon'] = '';
                }
 
                /* Add flags, such as new, minor, bot. */
-               if ($this->fld_flags) {
-                       if ($row->rc_bot)
+               if ( $this->fld_flags ) {
+                       if ( $row->rc_bot )
                                $vals['bot'] = '';
-                       if ($row->rc_new)
+                       if ( $row->rc_new )
                                $vals['new'] = '';
-                       if ($row->rc_minor)
+                       if ( $row->rc_minor )
                                $vals['minor'] = '';
                }
 
                /* Add sizes of each revision. (Only available on 1.10+) */
-               if ($this->fld_sizes) {
-                       $vals['oldlen'] = intval($row->rc_old_len);
-                       $vals['newlen'] = intval($row->rc_new_len);
+               if ( $this->fld_sizes ) {
+                       $vals['oldlen'] = intval( $row->rc_old_len );
+                       $vals['newlen'] = intval( $row->rc_new_len );
                }
 
                /* Add the timestamp. */
-               if ($this->fld_timestamp)
-                       $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rc_timestamp);
+               if ( $this->fld_timestamp )
+                       $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $row->rc_timestamp );
 
                /* Add edit summary / log summary. */
-               if ($this->fld_comment && isset($row->rc_comment)) {
+               if ( $this->fld_comment && isset( $row->rc_comment ) ) {
                        $vals['comment'] = $row->rc_comment;
                }
 
-               if ($this->fld_redirect)
-                       if($row->page_is_redirect)
+               if ( $this->fld_redirect )
+                       if ( $row->page_is_redirect )
                                $vals['redirect'] = '';
 
                /* Add the patrolled flag */
-               if ($this->fld_patrolled && $row->rc_patrolled == 1)
+               if ( $this->fld_patrolled && $row->rc_patrolled == 1 )
                        $vals['patrolled'] = '';
                        
-               if ($this->fld_loginfo && $row->rc_type == RC_LOG) {
-                       $vals['logid'] = intval($row->rc_logid);
+               if ( $this->fld_loginfo && $row->rc_type == RC_LOG ) {
+                       $vals['logid'] = intval( $row->rc_logid );
                        $vals['logtype'] = $row->rc_log_type;
                        $vals['logaction'] = $row->rc_log_action;
-                       ApiQueryLogEvents::addLogParams($this->getResult(),
+                       ApiQueryLogEvents::addLogParams( $this->getResult(),
                                $vals, $row->rc_params,
-                               $row->rc_log_type, $row->rc_timestamp);
+                               $row->rc_log_type, $row->rc_timestamp );
                }
                
-               if ($this->fld_tags) {
-                       if ($row->ts_tags) {
-                               $tags = explode(',', $row->ts_tags);
-                               $this->getResult()->setIndexedTagName($tags, 'tag');
+               if ( $this->fld_tags ) {
+                       if ( $row->ts_tags ) {
+                               $tags = explode( ',', $row->ts_tags );
+                               $this->getResult()->setIndexedTagName( $tags, 'tag' );
                                $vals['tags'] = $tags;
                        } else {
                                $vals['tags'] = array();
                        }
                }
                        
-               if(!is_null($this->token))
+               if ( !is_null( $this->token ) )
                {
                        $tokenFunctions = $this->getTokenFunctions();
-                       foreach($this->token as $t)
+                       foreach ( $this->token as $t )
                        {
-                               $val = call_user_func($tokenFunctions[$t], $row->rc_cur_id,
-                                       $title, RecentChange::newFromRow($row));
-                               if($val === false)
-                                       $this->setWarning("Action '$t' is not allowed for the current user");
+                               $val = call_user_func( $tokenFunctions[$t], $row->rc_cur_id,
+                                       $title, RecentChange::newFromRow( $row ) );
+                               if ( $val === false )
+                                       $this->setWarning( "Action '$t' is not allowed for the current user" );
                                else
                                        $vals[$t . 'token'] = $val;
                        }
@@ -383,16 +383,16 @@ class ApiQueryRecentChanges extends ApiQueryBase {
                return $vals;
        }
 
-       private function parseRCType($type)
+       private function parseRCType( $type )
        {
-                       if(is_array($type))
+                       if ( is_array( $type ) )
                        {
                                        $retval = array();
-                                       foreach($type as $t)
-                                                       $retval[] = $this->parseRCType($t);
+                                       foreach ( $type as $t )
+                                                       $retval[] = $this->parseRCType( $t );
                                        return $retval;
                        }
-                       switch($type)
+                       switch( $type )
                        {
                                        case 'edit': return RC_EDIT;
                                        case 'new': return RC_NEW;
@@ -444,7 +444,7 @@ class ApiQueryRecentChanges extends ApiQueryBase {
                                )
                        ),
                        'token' => array(
-                               ApiBase :: PARAM_TYPE => array_keys($this->getTokenFunctions()),
+                               ApiBase :: PARAM_TYPE => array_keys( $this->getTokenFunctions() ),
                                ApiBase :: PARAM_ISMULTI => true
                        ),
                        'show' => array (