Merge "Fix CodeSniffer errors and warnings"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 12 Mar 2014 12:53:40 +0000 (12:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 12 Mar 2014 12:53:40 +0000 (12:53 +0000)
includes/AutoLoader.php
includes/ChangesFeed.php
includes/specialpage/ChangesListSpecialPage.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php

index d4cc950..e5c3eeb 100644 (file)
@@ -96,7 +96,8 @@ $wgAutoloadLocalClasses = array(
        'HTMLFloatField' => 'includes/htmlform/HTMLFloatField.php',
        'HTMLForm' => 'includes/htmlform/HTMLForm.php',
        'HTMLFormField' => 'includes/htmlform/HTMLFormField.php',
-       'HTMLFormFieldRequiredOptionsException' => 'includes/htmlform/HTMLFormFieldRequiredOptionsException.php',
+       'HTMLFormFieldRequiredOptionsException' =>
+               'includes/htmlform/HTMLFormFieldRequiredOptionsException.php',
        'HTMLHiddenField' => 'includes/htmlform/HTMLHiddenField.php',
        'HTMLInfoField' => 'includes/htmlform/HTMLInfoField.php',
        'HTMLIntField' => 'includes/htmlform/HTMLIntField.php',
index cf05782..a5e5364 100644 (file)
@@ -67,10 +67,12 @@ class ChangesFeed {
        /**
         * Generates feed's content
         *
-        * @param $feed ChannelFeed subclass object (generally the one returned by getFeedObject())
-        * @param $rows ResultWrapper object with rows in recentchanges table
-        * @param $lastmod Integer: timestamp of the last item in the recentchanges table (only used for the cache key)
-        * @param $opts FormOptions as in SpecialRecentChanges::getDefaultOptions()
+        * @param ChannelFeed $feed ChannelFeed subclass object (generally the one returned
+        *   by getFeedObject())
+        * @param ResultWrapper $rows ResultWrapper object with rows in recentchanges table
+        * @param int $lastmod Timestamp of the last item in the recentchanges table (only
+        *   used for the cache key)
+        * @param FormOptions $opts As in SpecialRecentChanges::getDefaultOptions()
         * @return null|bool True or null
         */
        public function execute( $feed, $rows, $lastmod, $opts ) {
@@ -201,7 +203,10 @@ class ChangesFeed {
 
                foreach ( $sorted as $obj ) {
                        $title = Title::makeTitle( $obj->rc_namespace, $obj->rc_title );
-                       $talkpage = MWNamespace::canTalk( $obj->rc_namespace ) ? $title->getTalkPage()->getFullURL() : '';
+                       $talkpage = MWNamespace::canTalk( $obj->rc_namespace )
+                               ? $title->getTalkPage()->getFullURL()
+                               : '';
+
                        // Skip items with deleted content (avoids partially complete/inconsistent output)
                        if ( $obj->rc_deleted ) {
                                continue;
@@ -231,5 +236,4 @@ class ChangesFeed {
                wfProfileOut( __METHOD__ );
                return $items;
        }
-
 }
index c08d033..888829a 100644 (file)
  * @ingroup SpecialPage
  */
 abstract class ChangesListSpecialPage extends SpecialPage {
-       var $rcSubpage, $rcOptions; // @todo Rename these, make protected
+       /** @var string */
+       protected $rcSubpage;
+
+       /** @var FormOptions */
+       protected $rcOptions;
+
+       /** @var array */
        protected $customFilters;
 
        /**
index e05c8b8..720d0a8 100644 (file)
  * @ingroup SpecialPage
  */
 class SpecialRecentChanges extends ChangesListSpecialPage {
-
+       // @codingStandardsIgnoreStart Needed "useless" override to change parameters.
        public function __construct( $name = 'Recentchanges', $restriction = '' ) {
                parent::__construct( $name, $restriction );
        }
+       // @codingStandardsIgnoreEnd
 
        /**
         * Main execution point
@@ -285,7 +286,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
 
                $limit = $opts['limit'];
 
-               $showWatcherCount = $wgRCShowWatchingUsers && $this->getUser()->getOption( 'shownumberswatching' );
+               $showWatcherCount = $wgRCShowWatchingUsers
+                       && $this->getUser()->getOption( 'shownumberswatching' );
                $watcherCache = array();
 
                $dbr = $this->getDB();
@@ -334,7 +336,9 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
 
                if ( $rows->numRows() === 0 ) {
                        $this->getOutput()->addHtml(
-                               '<div class="mw-changeslist-empty">' . $this->msg( 'recentchanges-noresult' )->parse() . '</div>'
+                               '<div class="mw-changeslist-empty">' .
+                               $this->msg( 'recentchanges-noresult' )->parse() .
+                               '</div>'
                        );
                } else {
                        $this->getOutput()->addHTML( $rclistOutput );
@@ -688,7 +692,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                        'hideliu' => 'rcshowhideliu',
                        'hidepatrolled' => 'rcshowhidepatr',
                        'hidemyself' => 'rcshowhidemine'
-                 );
+               );
 
                $showhide = array( 'show', 'hide' );
 
index 34dd51f..c4f40be 100644 (file)
@@ -27,7 +27,8 @@
  * @ingroup SpecialPage
  */
 class SpecialRecentChangesLinked extends SpecialRecentChanges {
-       var $rclTargetTitle;
+       /** @var bool|Title */
+       protected $rclTargetTitle;
 
        function __construct() {
                parent::__construct( 'Recentchangeslinked' );
@@ -55,7 +56,8 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                $outputPage = $this->getOutput();
                $title = Title::newFromURL( $target );
                if ( !$title || $title->isExternal() ) {
-                       $outputPage->addHtml( '<div class="errorbox">' . $this->msg( 'allpagesbadtitle' )->parse() . '</div>' );
+                       $outputPage->addHtml( '<div class="errorbox">' . $this->msg( 'allpagesbadtitle' )
+                                       ->parse() . '</div>' );
                        return false;
                }
 
@@ -105,7 +107,9 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                        $opts['tagfilter']
                );
 
-               if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$select ) ) ) {
+               if ( !wfRunHooks( 'SpecialRecentChangesQuery',
+                       array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$select ) )
+               ) {
                        return false;
                }
 
@@ -128,14 +132,20 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                }
 
                // field name prefixes for all the various tables we might want to join with
-               $prefix = array( 'pagelinks' => 'pl', 'templatelinks' => 'tl', 'categorylinks' => 'cl', 'imagelinks' => 'il' );
+               $prefix = array(
+                       'pagelinks' => 'pl',
+                       'templatelinks' => 'tl',
+                       'categorylinks' => 'cl',
+                       'imagelinks' => 'il'
+               );
 
                $subsql = array(); // SELECT statements to combine with UNION
 
                foreach ( $link_tables as $link_table ) {
                        $pfx = $prefix[$link_table];
 
-                       // imagelinks and categorylinks tables have no xx_namespace field, and have xx_to instead of xx_title
+                       // imagelinks and categorylinks tables have no xx_namespace field,
+                       // and have xx_to instead of xx_title
                        if ( $link_table == 'imagelinks' ) {
                                $link_ns = NS_FILE;
                        } elseif ( $link_table == 'categorylinks' ) {