Improve documentation
authorSam Reed <reedy@users.mediawiki.org>
Tue, 21 Feb 2012 21:15:05 +0000 (21:15 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 21 Feb 2012 21:15:05 +0000 (21:15 +0000)
Fix whitespace

Fix weird conditional loading of DB_MASTER from specials/SpecialEditWatchlist.php

includes/Xml.php
includes/logging/LogEntry.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialEditWatchlist.php
includes/specials/SpecialVersion.php

index 3b043eb..8135a70 100644 (file)
@@ -213,13 +213,13 @@ class Xml {
                } else {
                        $languages = Language::getLanguageNames( $customisedOnly );
                }
-               
+
                // Make sure the site language is in the list; a custom language code might not have a
                // defined name...
                if( !array_key_exists( $wgLanguageCode, $languages ) ) {
                        $languages[$wgLanguageCode] = $wgLanguageCode;
                }
-               
+
                ksort( $languages );
 
                /**
index 66f0611..b2c4e1b 100644 (file)
@@ -495,6 +495,9 @@ class ManualLogEntry extends LogEntryBase {
                return $this->parameters;
        }
 
+       /**
+        * @return User
+        */
        public function getPerformer() {
                return $this->performer;
        }
index 6790352..a097d90 100644 (file)
@@ -25,7 +25,6 @@
  * Implements Special:DeletedContributions to display archived revisions
  * @ingroup SpecialPage
  */
-
 class DeletedContribsPager extends IndexPager {
        public $mDefaultDirection = true;
        var $messages, $target;
@@ -54,9 +53,9 @@ class DeletedContribsPager extends IndexPager {
                $user = $this->getUser();
                // Paranoia: avoid brute force searches (bug 17792)
                if( !$user->isAllowed( 'deletedhistory' ) ) {
-                       $conds[] = $this->mDb->bitAnd('ar_deleted',Revision::DELETED_USER) . ' = 0';
+                       $conds[] = $this->mDb->bitAnd( 'ar_deleted', Revision::DELETED_USER ) . ' = 0';
                } elseif( !$user->isAllowed( 'suppressrevision' ) ) {
-                       $conds[] = $this->mDb->bitAnd('ar_deleted',Revision::SUPPRESSED_USER) .
+                       $conds[] = $this->mDb->bitAnd( 'ar_deleted', Revision::SUPPRESSED_USER ) .
                                ' != ' . Revision::SUPPRESSED_USER;
                }
                return array(
@@ -130,6 +129,7 @@ class DeletedContribsPager extends IndexPager {
         * written by the target user.
         *
         * @todo This would probably look a lot nicer in a table.
+        * @param $row
         * @return string
         */
        function formatRow( $row ) {
@@ -346,6 +346,7 @@ class DeletedContributionsPage extends SpecialPage {
                } else {
                        $user = Linker::link( $userObj->getUserPage(), htmlspecialchars( $userObj->getName() ) );
                }
+               $links = '';
                $nt = $userObj->getUserPage();
                $id = $userObj->getID();
                $talk = $nt->getTalkPage();
index a7e97c8..296c98f 100644 (file)
@@ -297,9 +297,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
         * Attempts to clean up broken items
         */
        private function cleanupWatchlist() {
-               if ( count( $this->badItems ) ) {
-                       $dbw = wfGetDB( DB_MASTER );
-               }
+               $dbw = wfGetDB( DB_MASTER );
                foreach ( $this->badItems as $row ) {
                        list( $title, $namespace, $dbKey ) = $row;
                        wfDebug( "User {$this->getUser()} has broken watchlist item ns($namespace):$dbKey, "
index 97cfe77..597863b 100644 (file)
@@ -229,7 +229,7 @@ class SpecialVersion extends SpecialPage {
        }
 
        /**
-        * @return false|string wgVersion + HEAD sha1 stripped to the first 7 chars
+        * @return bool|string wgVersion + HEAD sha1 stripped to the first 7 chars. False on failure
         */
        private static function getVersionLinkedGit() {
                global $wgVersion, $IP;
@@ -387,6 +387,8 @@ class SpecialVersion extends SpecialPage {
 
        /**
         * Callback to sort extensions by type.
+        * @param $a array
+        * @param $b array
         * @return int
         */
        function compare( $a, $b ) {
@@ -621,6 +623,7 @@ class SpecialVersion extends SpecialPage {
         *        url                   The subversion URL of the directory
         *        repo-url              The base URL of the repository
         *        viewvc-url            A ViewVC URL pointing to the checked-out revision
+        * @param $dir string
         * @return array|bool
         */
        public static function getSvnInfo( $dir ) {
@@ -711,7 +714,7 @@ class SpecialVersion extends SpecialPage {
 
        /**
         * @param $dir String: directory of the git checkout
-        * @return false|String sha1 of commit HEAD points to
+        * @return bool|String sha1 of commit HEAD points to
         */
        public static function getGitHeadSha1( $dir ) {
                $BASEDIR  = "{$dir}/.git/";
@@ -722,19 +725,18 @@ class SpecialVersion extends SpecialPage {
                }
 
                preg_match( "/ref: (.*)/",
-                       file_get_contents( $HEADfile), $m );
+                       file_get_contents( $HEADfile), $m );
 
                $REFfile = "{$BASEDIR}{$m[1]}";
                if( !file_exists( $REFfile ) ) {
                        return false;
                }
 
-               $sha1 = chop(file_get_contents( $REFfile ));
+               $sha1 = rtrim( file_get_contents( $REFfile ) );
 
                return $sha1;
        }
 
-
        function showEasterEgg() {
                $rx = $rp = $xe = '';
                $alpha = array("", "kbQW", "\$\n()");