dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Update OOjs UI to v0.1.0-pre (d2451ac748)"
[lhc/web/wiklou.git]
/
includes
/
cache
/
GenderCache.php
diff --git
a/includes/cache/GenderCache.php
b/includes/cache/GenderCache.php
index
a933527
..
63e7bfd
100644
(file)
--- a/
includes/cache/GenderCache.php
+++ b/
includes/cache/GenderCache.php
@@
-41,27
+41,30
@@
class GenderCache {
if ( $that === null ) {
$that = new self();
}
if ( $that === null ) {
$that = new self();
}
+
return $that;
}
return $that;
}
- protected function __construct() {}
+ protected function __construct() {
+ }
/**
* Returns the default gender option in this wiki.
/**
* Returns the default gender option in this wiki.
- * @return
S
tring
+ * @return
s
tring
*/
protected function getDefault() {
if ( $this->default === null ) {
$this->default = User::getDefaultOption( 'gender' );
}
*/
protected function getDefault() {
if ( $this->default === null ) {
$this->default = User::getDefaultOption( 'gender' );
}
+
return $this->default;
}
/**
* Returns the gender for given username.
return $this->default;
}
/**
* Returns the gender for given username.
- * @param string
$username or User: u
sername
- * @param string $caller
t
he calling method
- * @return
S
tring
+ * @param string
|User $username U
sername
+ * @param string $caller
T
he calling method
+ * @return
s
tring
*/
public function getGenderOf( $username, $caller = '' ) {
global $wgUser;
*/
public function getGenderOf( $username, $caller = '' ) {
global $wgUser;
@@
-77,8
+80,8
@@
class GenderCache {
$this->misses++;
wfDebug( __METHOD__ . ": too many misses, returning default onwards\n" );
}
$this->misses++;
wfDebug( __METHOD__ . ": too many misses, returning default onwards\n" );
}
- return $this->getDefault();
+ return $this->getDefault();
} else {
$this->misses++;
$this->doQuery( $username, $caller );
} else {
$this->misses++;
$this->doQuery( $username, $caller );
@@
-94,8
+97,8
@@
class GenderCache {
/**
* Wrapper for doQuery that processes raw LinkBatch data.
*
/**
* Wrapper for doQuery that processes raw LinkBatch data.
*
- * @param $data
- * @param $caller
+ * @param
array
$data
+ * @param
string
$caller
*/
public function doLinkBatch( $data, $caller = '' ) {
$users = array();
*/
public function doLinkBatch( $data, $caller = '' ) {
$users = array();
@@
-115,8
+118,8
@@
class GenderCache {
* Wrapper for doQuery that processes a title or string array.
*
* @since 1.20
* Wrapper for doQuery that processes a title or string array.
*
* @since 1.20
- * @param
$titles List: a
rray of Title objects or strings
- * @param string $caller
t
he calling method
+ * @param
array $titles A
rray of Title objects or strings
+ * @param string $caller
T
he calling method
*/
public function doTitlesArray( $titles, $caller = '' ) {
$users = array();
*/
public function doTitlesArray( $titles, $caller = '' ) {
$users = array();
@@
-136,8
+139,8
@@
class GenderCache {
/**
* Preloads genders for given list of users.
/**
* Preloads genders for given list of users.
- * @param
$users List|String: u
sernames
- * @param string $caller
t
he calling method
+ * @param
array|string $users U
sernames
+ * @param string $caller
T
he calling method
*/
public function doQuery( $users, $caller = '' ) {
$default = $this->getDefault();
*/
public function doQuery( $users, $caller = '' ) {
$default = $this->getDefault();
@@
-184,6
+187,7
@@
class GenderCache {
if ( $indexSlash !== false ) {
$username = substr( $username, 0, $indexSlash );
}
if ( $indexSlash !== false ) {
$username = substr( $username, 0, $indexSlash );
}
+
// normalize underscore/spaces
return strtr( $username, '_', ' ' );
}
// normalize underscore/spaces
return strtr( $username, '_', ' ' );
}