* same channel are concatenated, but any intervening messages in another
* channel start a new line.
* @param $msg String: the message without trailing newline
- * @param $channel Channel identifier or null for no
+ * @param $channel string Channel identifier or null for no
* channel. Channel comparison uses ===.
*/
public function outputChanneled( $msg, $channel = null ) {
/**
* Lock the search index
- * @param &$db Database object
+ * @param &$db DatabaseBase object
*/
private function lockSearchindex( &$db ) {
$write = array( 'searchindex' );
/**
* Unlock the tables
- * @param &$db Database object
+ * @param &$db DatabaseBase object
*/
private function unlockSearchindex( &$db ) {
$db->unlockTables( __CLASS__ . '::' . __METHOD__ );
/**
* Unlock and lock again
* Since the lock is low-priority, queued reads will be able to complete
- * @param &$db Database object
+ * @param &$db DatabaseBase object
*/
private function relockSearchindex( &$db ) {
$this->unlockSearchindex( $db );
/**
* Update the searchindex table for a given pageid
- * @param $dbw Database: a database write handle
+ * @param $dbw DatabaseBase a database write handle
* @param $pageId Integer: the page ID to update.
* @return null|string
*/
// Discourage the server from disconnecting us if it takes a long time
// to read out the big ol' batch query.
- $db->setTimeout( 3600 * 24 );
+ $db->setSessionOptions( array( 'connTimeout' => 3600 * 24 ) );
return $db;
}
* may not survive a long-term server outage.
*
* FIXME: WTF? Why is it using a loop and then returning unconditionally?
+ * @param $id int
+ * @return bool|string
*/
private function getTextDbSafe( $id ) {
while ( true ) {
/**
* Get hooks from a PHP file
- * @param $file Full filename to the PHP file.
+ * @param $file string Full filename to the PHP file.
* @return array of hooks found.
*/
private function getHooksFromFile( $file ) {
/**
* Get bad hooks (where the hook name could not be determined) from a PHP file
- * @param $file Full filename to the PHP file.
+ * @param $file string Full filename to the PHP file.
* @return array of bad wfRunHooks() lines
*/
private function getBadHooksFromFile( $file ) {
* Returns the matched character slash-escaped as in a C string
* Helper for makeTitleSafe callback
* @param $matches
- * @return atring
+ * @return string
*/
static private function stringEscape( $matches ) {
return sprintf( "\\x%02x", ord( $matches[1] ) );
* @return String
*/
function guessPriority( $namespace ) {
- return MWNamespace::isMain( $namespace ) ? $this->priorities[self::GS_MAIN] : $this->priorities[self::GS_TALK];
+ return MWNamespace::isSubject( $namespace ) ? $this->priorities[self::GS_MAIN] : $this->priorities[self::GS_TALK];
}
/**
/**
* Search a directory for files with one of a set of extensions
*
- * @param $dir Path to directory to search
+ * @param $dir string Path to directory to search
* @param $exts Array of extensions to search for
* @return mixed Array of filenames on success, or false on failure
*/
* files for acme.foo.bar and the extension ".txt". With $maxStrip = 2,
* acme.txt would also be acceptable.
*
- * @param $file base path
- * @param $auxExtension the extension to be appended to the base path
- * @param $maxStrip the maximum number of extensions to strip from the base path (default: 1)
+ * @param $file string base path
+ * @param $auxExtension string the extension to be appended to the base path
+ * @param $maxStrip int the maximum number of extensions to strip from the base path (default: 1)
* @return string or false
*/
function findAuxFile( $file, $auxExtension, $maxStrip = 1 ) {
/**
* Constructor.
- * @param $options Options for script.
+ * @param $options array Options for script.
*/
public function __construct( Array $options ) {
if ( isset( $options['help'] ) ) {
/**
* Get the default checks.
- * @return A list of the default checks.
+ * @return array A list of the default checks.
*/
protected function defaultChecks() {
return array(
/**
* Get the checks which check other things than messages.
- * @return A list of the non-message checks.
+ * @return array A list of the non-message checks.
*/
protected function nonMessageChecks() {
return array(
/**
* Get all checks.
- * @return An array of all check names mapped to their function names.
+ * @return array An array of all check names mapped to their function names.
*/
protected function getChecks() {
return array(
/**
* Get total count for each check non-messages check.
- * @return An array of all check names mapped to a two-element array:
+ * @return array An array of all check names mapped to a two-element array:
* function name to get the total count and language code or null
* for checked code.
*/
/**
* Get all check descriptions.
- * @return An array of all check names mapped to their descriptions.
+ * @return array An array of all check names mapped to their descriptions.
*/
protected function getDescriptions() {
return array(
/**
* Get help.
- * @return The help string.
+ * @return string The help string.
*/
protected function help() {
return <<<ENDS
/**
* Get the check blacklist.
- * @return The list of checks which should not be executed.
+ * @return array The list of checks which should not be executed.
*/
protected function getCheckBlacklist() {
global $checkBlacklist;
/**
* Format a message key.
- * @param $key The message key.
- * @param $code The language code.
- * @return The formatted message key.
+ * @param $key string The message key.
+ * @param $code string The language code.
+ * @return string The formatted message key.
*/
protected function formatKey( $key, $code ) {
if ( $this->doLinks ) {
/**
* Output the checks results as plain text.
- * @return The checks results as plain text.
*/
protected function outputText() {
foreach ( $this->results as $code => $results ) {
/**
* Output the checks results as wiki text.
- * @return The checks results as wiki text.
*/
function outputWiki() {
global $wgContLang;
/**
* Check if there are any results for the checks, in any language.
- * @return True if there are any results, false if not.
+ * @return bool True if there are any results, false if not.
*/
protected function isEmpty() {
foreach( $this->results as $results ) {
/**
* Constructor.
- * @param $options Options for script.
- * @param $extension The extension name (or names).
+ * @param $options array Options for script.
+ * @param $extension string The extension name (or names).
*/
public function __construct( Array $options, $extension ) {
if ( isset( $options['help'] ) ) {
/**
* Get the default checks.
- * @return A list of the default checks.
+ * @return array A list of the default checks.
*/
protected function defaultChecks() {
return array(
/**
* Get the checks which check other things than messages.
- * @return A list of the non-message checks.
+ * @return array A list of the non-message checks.
*/
protected function nonMessageChecks() {
return array();
/**
* Get the checks that can easily be treated by non-speakers of the language.
- * @return A list of the easy checks.
+ * @return arrayA list of the easy checks.
*/
protected function easyChecks() {
return array(
/**
* Get help.
- * @return The help string.
+ * @return string The help string.
*/
protected function help() {
return <<<ENDS
* Load the list of languages: all the Messages*.php
* files in the languages directory.
*
- * @param $exif Treat the EXIF messages?
+ * @param $exif bool Treat the EXIF messages?
*/
function __construct( $exif = true ) {
require( dirname(__FILE__) . '/messageTypes.inc' );
*
* @param $code string The language code.
*
- * @return Namespace names.
+ * @return array Namespace names.
*/
public function getNamespaceNames( $code ) {
$this->loadFile( $code );
*
* @param $code string The language code.
*
- * @return Namespace aliases.
+ * @return array Namespace aliases.
*/
public function getNamespaceAliases( $code ) {
$this->loadFile( $code );
*
* @param $code string The language code.
*
- * @return Magic words.
+ * @return array Magic words.
*/
public function getMagicWords( $code ) {
$this->loadFile( $code );
*
* @param $code string The language code.
*
- * @return Special page aliases.
+ * @return array Special page aliases.
*/
public function getSpecialPageAliases( $code ) {
$this->loadFile( $code );
/**
* Load the messages group.
- * @param $group The messages group.
+ * @param $group MessageGroup The messages group.
*/
function __construct( MessageGroup $group ) {
$this->mMessageGroup = $group;
* Rewrite a messages array.
*
* @param $languages
- * @param $code The language code.
+ * @param $code string The language code.
* @param bool $write Write to the messages file?
* @param bool $listUnknown List the unknown messages?
* @param bool $removeUnknown Remove the unknown messages?
* @param bool $removeDupes Remove the duplicated messages?
- * @param $dupeMsgSource The source file intended to remove from the array.
+ * @param $dupeMsgSource string The source file intended to remove from the array.
*/
function rebuildLanguage( $languages, $code, $write, $listUnknown, $removeUnknown, $removeDupes, $dupeMsgSource ) {
$messages = $languages->getMessages( $code );
/**
* Remove duplicates from a message array.
*
- * @param $oldMsgArray The input message array.
- * @param $dupeMsgSource The source file path for duplicates.
+ * @param $oldMsgArray array The input message array.
+ * @param $dupeMsgSource string The source file path for duplicates.
* @return Array $newMsgArray The output message array, with duplicates removed.
*/
function removeDupes( $oldMsgArray, $dupeMsgSource ) {
* @param $messages Array: key of messages.
* @param $ignored Array: list of ingored message keys.
* @param $optional Array: list of optional message keys.
+ * @return array
*/
public static function makeComments( $messages, $ignored, $optional ) {
# Comment collector
* @param $messageComments Array: optional comments for messages in this block.
* @param $prefix String: prefix for every line, for indenting purposes.
*
- * @return The block, formatted in PHP.
+ * @return string The block, formatted in PHP.
*/
public static function writeMessagesBlock( $blockComment, $messages,
$messageComments = array(), $prefix = '' ) {
* store it in the dead session tracking if it still has locks.
*
* @param $socket resource
- * @return book
+ * @return bool
*/
protected function recordDeadSocket( $socket ) {
$session = array_search( $socket, $this->sessions );
/**
* @param $sock resource
- * @return string|false
+ * @return string|bool
*/
public function readRcvBuffer( $sock ) {
$key = array_search( $sock, $this->clients );
*
* @param $from User to take edits from
* @param $to User to assign edits to
- * @param $rc Update the recent changes table
- * @param $report Don't change things; just echo numbers
+ * @param $rc bool Update the recent changes table
+ * @param $report bool Don't change things; just echo numbers
* @return integer Number of entries changed, or that would be changed
*/
private function doReassignEdits( &$from, &$to, $rc = false, $report = false ) {
/**
* Initialise the user object
*
- * @param $username Username or IP address
+ * @param $username string Username or IP address
* @return User
*/
private function initialiseUser( $username ) {
/**
* Helper function to rebuild list of languages codes. Prints the code
* for each language which is rebuilt.
- * @param $codes list List of language codes to rebuild.
+ * @param $codes array List of language codes to rebuild.
* @param $lc LocalisationCache Instance of LocalisationCache_BulkLoad (?)
* @param $force bool Rebuild up-to-date languages
* @return int Number of rebuilt languages
* Removes non-existing links from pages from pagelinks, imagelinks,
* categorylinks, templatelinks, externallinks, interwikilinks, langlinks and redirect tables.
*
- * @param $maxLag
- * @param $batchSize The size of deletion batches
+ * @param $maxLag int
+ * @param $batchSize int The size of deletion batches
*
* @author Merlijn van Deen <valhallasw@arctus.nl>
*/
* (No edits, no deleted edits, no log entries, no current/old uploads)
*
* @param $id User's ID
- * @param $master Perform checking on the master
+ * @param $master bool Perform checking on the master
* @return bool
*/
private function isInactiveAccount( $id, $master = false ) {
/**
* Open a connection to the master server with the admin rights.
- * @return Database
+ * @return DatabaseBase
* @access private
*/
function newConnection() {
* Open a second connection to the master server, with buffering off.
* This will let us stream large datasets in and write in chunks on the
* other end.
- * @return Database
+ * @return DatabaseBase
* @access private
*/
function streamConnection() {
* MW_UPGRADE_COPY - straight copy
* MW_UPGRADE_ENCODE - for old Latin1 wikis, conv to UTF-8
* MW_UPGRADE_NULL - just put NULL
- * @param callable $callback An optional callback to modify the data
+ * @param $callback callback An optional callback to modify the data
* or perform other processing. Func should be
* ( object $row, array $copy ) and return $copy
* @access private
* @param $opts array
* @param $args array
*
- * @return true
+ * @return bool
*/
private function initializeOpts( $opts, $args ) {