r101022 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101021‎ | r101022 | r101023 >
Date:18:45, 27 October 2011
Author:petrb
Status:ok (Comments)
Tags:
Comment:
fixed spaces
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php (modified) (history)
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php
@@ -29,9 +29,9 @@
3030
3131 /**
3232 * Returns image
33 - * @param $mode User
34 - * @return string
35 - */
 33+ * @param $mode User
 34+ * @return string
 35+ */
3636 public static function GetImageHtml( $mode ) {
3737 global $wgExtensionAssetsPath, $wgOnlineStatusBarIcon, $wgOnlineStatusBarModes;
3838 $icon = "$wgExtensionAssetsPath/OnlineStatusBar/{$wgOnlineStatusBarIcon[$mode]}";
@@ -40,29 +40,29 @@
4141 }
4242
4343 /**
44 - * @param $title Title
45 - * @return user
46 - */
 44+ * @param $title Title
 45+ * @return user
 46+ */
4747 public static function GetOwnerFromTitle ( $title )
4848 {
4949 if ( $title === null ) {
5050 return null;
5151 }
5252 $username = $title->getBaseText();
53 - $user_object = User::newFromName ( $username );
 53+ $user_object = User::newFromName ( $username );
5454 return $user_object;
5555 }
5656
5757 /**
58 - * @return bool
59 - */
 58+ * @return bool
 59+ */
6060 public static function UpdateDb() {
6161 global $wgUser, $wgOnlineStatusBarDefaultOnline;
6262 if ( OnlineStatusBar::GetStatus( $wgUser->getName() ) != $wgOnlineStatusBarDefaultOnline ) {
6363 $dbw = wfGetDB( DB_MASTER );
6464 $row = array(
6565 'username' => $wgUser->getName(),
66 - 'timestamp' => $dbw->timestamp(),
 66+ 'timestamp' => $dbw->timestamp(),
6767 );
6868 $dbw->insert( 'online_status', $row, __METHOD__, 'DELAYED' );
6969 }
@@ -70,8 +70,8 @@
7171 }
7272
7373 /**
74 - * @return bool
75 - */
 74+ * @return bool
 75+ */
7676 public static function UpdateStatus() {
7777 global $wgUser, $wgOnlineStatusBarDefaultOffline;
7878 if ( OnlineStatusBar::GetStatus( $wgUser->getName() ) == $wgOnlineStatusBarDefaultOffline ) {
@@ -85,13 +85,12 @@
8686 array( 'username' => $wgUser->getID() ),
8787 __METHOD__
8888 );
89 -
9089 return false;
9190 }
9291
9392 /**
94 - * @return int
95 - */
 93+ * @return int
 94+ */
9695 public static function DeleteOld() {
9796 global $wgOnlineStatusBar_LogoutTime, $wgDBname;
9897 $dbw = wfGetDB( DB_MASTER );
@@ -103,9 +102,9 @@
104103
105104
106105 /**
107 - * @param $userName string
108 - * @return bool
109 - */
 106+ * @param $userName string
 107+ * @return bool
 108+ */
110109 public static function IsValid( $userName ) {
111110 global $wgOnlineStatusBarDefaultIpUsers, $wgOnlineStatusBarDefaultEnabled;
112111 // checks if anon
@@ -118,13 +117,13 @@
119118 return false;
120119 }
121120 // do we track them
122 - return $user->getOption( "OnlineStatusBar_active", $wgOnlineStatusBarDefaultEnabled );
 121+ return $user->getOption( "OnlineStatusBar_active", $wgOnlineStatusBarDefaultEnabled );
123122 }
124123
125124 /**
126 - * @param $userName string
127 - * @return string
128 - */
 125+ * @param $userName string
 126+ * @return string
 127+ */
129128 static function GetStatus( $userName ) {
130129 global $wgOnlineStatusBarModes, $wgOnlineStatusBarDefaultOffline, $wgOnlineStatusBarDefaultIpUsers, $wgOnlineStatusBarDefaultOnline, $wgDBname;
131130 $dbw = wfGetDB( DB_MASTER );
@@ -147,8 +146,8 @@
148147
149148 /**
150149 * @param $userName string
151 - * @return bool
152 - */
 150+ * @return bool
 151+ */
153152 static function DeleteStatus( $userName ) {
154153 $dbw = wfGetDB( DB_MASTER );
155154 $dbw->delete( 'online_status', array( 'username' => $userName ), __METHOD__ ); // delete user
Index: trunk/extensions/OnlineStatusBar/OnlineStatusBarHooks.php
@@ -171,7 +171,7 @@
172172 }
173173 $ret = OnlineStatusBar::GetStatus( $name );
174174 if ( $ret == "hidden" ) {
175 - $ret = $wgOnlineStatusBarDefaultOffline;
 175+ $ret = $wgOnlineStatusBarDefaultOffline;
176176 }
177177 }
178178 return true;

Comments

#Comment by Nikerabbit (talk | contribs)   06:39, 28 October 2011

Yay!

Status & tagging log