* as a standalone class? It checks that the call stack only includes this
* function and "requires" (meaning was called from the file scope)
*
- * @return Boolean
+ * @return bool
*/
public static function shouldExecute() {
$bt = debug_backtrace();
* Add a parameter to the script. Will be displayed on --help
* with the associated description
*
- * @param $name String: the name of the param (help, version, etc)
- * @param $description String: the description of the param to show on --help
- * @param $required Boolean: is the param required?
- * @param $withArg Boolean: is an argument required with this option?
- * @param $shortName String: character to use as short name
+ * @param string $name The name of the param (help, version, etc)
+ * @param string $description The description of the param to show on --help
+ * @param bool $required Is the param required?
+ * @param bool $withArg Is an argument required with this option?
+ * @param string $shortName Character to use as short name
*/
protected function addOption( $name, $description, $required = false, $withArg = false, $shortName = false ) {
$this->mParams[$name] = array( 'desc' => $description, 'require' => $required, 'withArg' => $withArg, 'shortName' => $shortName );
/**
* Checks to see if a particular param exists.
- * @param $name String: the name of the param
- * @return Boolean
+ * @param string $name The name of the param
+ * @return bool
*/
protected function hasOption( $name ) {
return isset( $this->mOptions[$name] );
/**
* Get an option, or return the default
- * @param $name String: the name of the param
- * @param $default Mixed: anything you want, default null
- * @return Mixed
+ * @param string $name The name of the param
+ * @param mixed $default Anything you want, default null
+ * @return mixed
*/
protected function getOption( $name, $default = null ) {
if ( $this->hasOption( $name ) ) {
/**
* Add some args that are needed
- * @param $arg String: name of the arg, like 'start'
- * @param $description String: short description of the arg
- * @param $required Boolean: is this required?
+ * @param string $arg Name of the arg, like 'start'
+ * @param string $description Short description of the arg
+ * @param bool $required Is this required?
*/
protected function addArg( $arg, $description, $required = true ) {
$this->mArgList[] = array(
/**
* Remove an option. Useful for removing options that won't be used in your script.
- * @param $name String: the option to remove.
+ * @param string $name The option to remove.
*/
protected function deleteOption( $name ) {
unset( $this->mParams[$name] );
/**
* Set the description text.
- * @param $text String: the text of the description
+ * @param string $text The text of the description
*/
protected function addDescription( $text ) {
$this->mDescription = $text;
/**
* Does a given argument exist?
- * @param $argId Integer: the integer value (from zero) for the arg
- * @return Boolean
+ * @param int $argId The integer value (from zero) for the arg
+ * @return bool
*/
protected function hasArg( $argId = 0 ) {
return isset( $this->mArgs[$argId] );
/**
* Get an argument.
- * @param $argId Integer: the integer value (from zero) for the arg
- * @param $default Mixed: the default if it doesn't exist
+ * @param int $argId The integer value (from zero) for the arg
+ * @param mixed $default The default if it doesn't exist
* @return mixed
*/
protected function getArg( $argId = 0, $default = null ) {
/**
* Set the batch size.
- * @param $s Integer: the number of operations to do in a batch
+ * @param int $s The number of operations to do in a batch
*/
protected function setBatchSize( $s = 0 ) {
$this->mBatchSize = $s;
/**
* Get the script's name
- * @return String
+ * @return string
*/
public function getName() {
return $this->mSelf;
/**
* Return input from stdin.
- * @param $len Integer: the number of bytes to read. If null,
- * just return the handle. Maintenance::STDIN_ALL returns
- * the full length
- * @return Mixed
+ * @param int $len The number of bytes to read. If null, just return the handle.
+ * Maintenance::STDIN_ALL returns the full length
+ * @return mixed
*/
protected function getStdin( $len = null ) {
if ( $len == Maintenance::STDIN_ALL ) {
/**
* Throw some output to the user. Scripts can call this with no fears,
* as we handle all --quiet stuff here
- * @param $out String: the text to show to the user
- * @param $channel Mixed: unique identifier for the channel. See
- * function outputChanneled.
+ * @param string $out The text to show to the user
+ * @param mixed $channel Unique identifier for the channel. See function outputChanneled.
*/
protected function output( $out, $channel = null ) {
if ( $this->mQuiet ) {
/**
* Throw an error to the user. Doesn't respect --quiet, so don't use
* this for non-error output
- * @param $err String: the error to display
- * @param $die Int: if > 0, go ahead and die out using this int as the code
+ * @param string $err The error to display
+ * @param int $die If > 0, go ahead and die out using this int as the code
*/
protected function error( $err, $die = 0 ) {
$this->outputChanneled( false );
* Message outputter with channeled message support. Messages on the
* 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 string Channel identifier or null for no
+ * @param string $msg The message without trailing newline
+ * @param string $channel Channel identifier or null for no
* channel. Channel comparison uses ===.
*/
public function outputChanneled( $msg, $channel = null ) {
* Maintenance::DB_NONE - For no DB access at all
* Maintenance::DB_STD - For normal DB access, default
* Maintenance::DB_ADMIN - For admin DB access
- * @return Integer
+ * @return int
*/
public function getDbType() {
return Maintenance::DB_STD;
/**
* Run a child maintenance script. Pass all of the current arguments
* to it.
- * @param $maintClass String: a name of a child maintenance class
- * @param $classFile String: full path of where the child is
- * @return Maintenance child
+ * @param string $maintClass A name of a child maintenance class
+ * @param string $classFile Full path of where the child is
+ * @return Maintenance
*/
public function runChild( $maintClass, $classFile = null ) {
// Make sure the class is loaded first
* $mOptions becomes an array with keys set to the option names
* $mArgs becomes a zero-based array containing the non-option arguments
*
- * @param $self String The name of the script, if any
- * @param $opts Array An array of options, in form of key=>value
- * @param $args Array An array of command line arguments
+ * @param string $self The name of the script, if any
+ * @param array $opts An array of options, in form of key=>value
+ * @param array $args An array of command line arguments
*/
public function loadParamsAndArgs( $self = null, $opts = null, $args = null ) {
# If we were given opts or args, set those and return early
/**
* Maybe show the help.
- * @param $force boolean Whether to force the help to show, default false
+ * @param bool $force Whether to force the help to show, default false
*/
protected function maybeHelp( $force = false ) {
if ( !$force && !$this->hasOption( 'help' ) ) {
/**
* Generic setup for most installs. Returns the location of LocalSettings
- * @return String
+ * @return string
*/
public function loadSettings() {
global $wgCommandLineMode, $IP;
/**
* Support function for cleaning up redundant text records
- * @param $delete Boolean: whether or not to actually delete the records
+ * @param bool $delete Whether or not to actually delete the records
* @author Rob Church <robchur@gmail.com>
*/
public function purgeRedundantText( $delete = true ) {
/**
* Sets database object to be returned by getDB().
*
- * @param $db DatabaseBase: Database object to be used
+ * @param DatabaseBase $db Database object to be used
*/
public function setDB( &$db ) {
$this->mDb = $db;
/**
* Lock the search index
- * @param &$db DatabaseBase object
+ * @param DatabaseBase &$db
*/
private function lockSearchindex( &$db ) {
$write = array( 'searchindex' );
/**
* Unlock the tables
- * @param &$db DatabaseBase object
+ * @param DatabaseBase &$db
*/
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 DatabaseBase object
+ * @param DatabaseBase &$db
*/
private function relockSearchindex( &$db ) {
$this->unlockSearchindex( $db );
/**
* Perform a search index update with locking
- * @param $maxLockTime Integer: the maximum time to keep the search index locked.
- * @param $callback callback String: the function that will update the function.
- * @param $dbw DatabaseBase object
- * @param $results
+ * @param int $maxLockTime The maximum time to keep the search index locked.
+ * @param string $callback The function that will update the function.
+ * @param DatabaseBase $dbw
+ * @param array $results
*/
public function updateSearchIndex( $maxLockTime, $callback, $dbw, $results ) {
$lockTime = time();
/**
* Update the searchindex table for a given pageid
- * @param $dbw DatabaseBase a database write handle
- * @param $pageId Integer: the page ID to update.
+ * @param DatabaseBase $dbw A database write handle
+ * @param int $pageId The page ID to update.
* @return null|string
*/
public function updateSearchIndexForPage( $dbw, $pageId ) {
* We default as considering stdin a tty (for nice readline methods)
* but treating stout as not a tty to avoid color codes
*
- * @param $fd int File descriptor
+ * @param int $fd File descriptor
* @return bool
*/
public static function posix_isatty( $fd ) {
/**
* Prompt the console for input
- * @param $prompt String what to begin the line with, like '> '
- * @return String response
+ * @param string $prompt What to begin the line with, like '> '
+ * @return string Response
*/
public static function readconsole( $prompt = '> ' ) {
static $isatty = null;
/**
* Emulate readline()
- * @param $prompt String what to begin the line with, like '> '
- * @return String
+ * @param string $prompt What to begin the line with, like '> '
+ * @return string
*/
private static function readlineEmulation( $prompt ) {
$bash = Installer::locateExecutableInDefaultPaths( array( 'bash' ) );
/**
* Message to show that the update was done already and was just skipped
- * @return String
+ * @return string
*/
protected function updateSkippedMessage() {
$key = $this->getUpdateKey();
/**
* Message to show the the update log was unable to log the completion of this update
- * @return String
+ * @return string
*/
protected function updatelogFailedMessage() {
$key = $this->getUpdateKey();
/**
* Do the actual work. All child classes will need to implement this.
* Return true to log the update as done or false (usually on failure).
- * @return Bool
+ * @return bool
*/
abstract protected function doDBUpdates();
/**
* Get the update key name to go in the update log table
- * @return String
+ * @return string
*/
abstract protected function getUpdateKey();
}
}
/**
- * @param $name String
- * @param $class String: name of output filter plugin class
+ * @param string $name
+ * @param string $class Name of output filter plugin class
*/
function registerOutput( $name, $class ) {
$this->outputTypes[$name] = $class;
}
/**
- * @param $name String
- * @param $class String: name of filter plugin class
+ * @param string $name
+ * @param string $class Name of filter plugin class
*/
function registerFilter( $name, $class ) {
$this->filterTypes[$name] = $class;
/**
* Load a plugin and register it
*
- * @param $class String: name of plugin class; must have a static 'register'
- * method that takes a BackupDumper as a parameter.
- * @param $file String: full or relative path to the PHP file to load, or empty
+ * @param string $class Name of plugin class; must have a static 'register'
+ * method that takes a BackupDumper as a parameter.
+ * @param string $file Full or relative path to the PHP file to load, or empty
*/
function loadPlugin( $class, $file ) {
if ( $file != '' ) {
}
/**
- * @param $args Array
- * @return Array
+ * @param array $args
+ * @return array
*/
function processArgs( $args ) {
$sink = null;
* Initialise starting time and maximum revision count.
* We'll make ETA calculations based an progress, assuming relatively
* constant per-revision rate.
- * @param $history Integer: WikiExporter::CURRENT or WikiExporter::FULL
+ * @param int $history WikiExporter::CURRENT or WikiExporter::FULL
*/
function initProgress( $history = WikiExporter::FULL ) {
$table = ( $history == WikiExporter::CURRENT ) ? 'page' : 'revision';
* Force the dump to use the provided database connection for database
* operations, wherever possible.
*
- * @param $db DatabaseBase|null: (Optional) the database connection to
- * use. If null, resort to use the globally provided ways to
- * get database connections.
+ * @param DatabaseBase|null $db (Optional) the database connection to use. If null, resort to
+ * use the globally provided ways to get database connections.
*/
function setDb( DatabaseBase $db = null ) {
$this->forcedDb = $db;
* from the dump stream. May return null if the page is
* unavailable.
*
- * @param $page Integer: ID number of page to read
- * @param $rev Integer: ID number of revision to read
- * @return string or null
+ * @param int $page ID number of page to read
+ * @param int $rev ID number of revision to read
+ * @return string|null
*/
function prefetch( $page, $rev ) {
$page = intval( $page );
/**
* @access private
- * @param $name string
- * @param $parent string
+ * @param string $name
+ * @param string $parent
* @return bool|null
*/
function skipTo( $name, $parent = 'page' ) {
* Fetches text contents of the current element, assuming
* no sub-elements or such scary things.
*
- * @return String
+ * @return string
* @access private
*/
function nodeContents() {
* $this->maxConsecutiveFailedTextRetrievals consecutive calls to getText, MWException
* is thrown.
*
- * @param $id string The revision id to get the text for
+ * @param string $id The revision id to get the text for
*
* @return string The revision text for $id, or ""
* @throws MWException
/**
* May throw a database error if, say, the server dies during query.
- * @param $id
+ * @param int $id
* @return bool|string
* @throws MWException
*/
}
/**
- * @param $dbw DatabaseBase
+ * @param DatabaseBase $dbw
* @return void
*/
private function insertData( $dbw ) {
}
/**
- * @param $dbw DatabaseBase
+ * @param DatabaseBase $dbw
* @return void
*/
private function delete( $dbw ) {
}
/**
- * @param $dbw DatabaseBase
+ * @param DatabaseBase $dbw
* @return void
*/
private function truncate( $dbw ) {
}
/**
- * @param $trials int
+ * @param int $trials
* @return string
*/
private function benchHooks( $trials = 10 ) {
/**
* Run a bunch of URLs through SquidUpdate::purge()
* to benchmark Squid response times.
- * @param $urls array A bunch of URLs to purge
- * @param $trials int How many times to run the test?
+ * @param array $urls A bunch of URLs to purge
+ * @param int $trials How many times to run the test?
* @return string
*/
private function benchSquid( $urls, $trials = 1 ) {
/**
* Get an array of randomUrl()'s.
- * @param $length int How many urls to add to the array
+ * @param int $length How many urls to add to the array
* @return array
*/
private function randomUrlList( $length ) {
/**
* Returns a list of tracked files in a Git work tree differing from the master branch.
- * @param $path string: Path to the repository
- * @return array: Resulting list of changed files
+ * @param string $path Path to the repository
+ * @return array Resulting list of changed files
*/
private function getGitModifiedFiles( $path ) {
/**
* Returns true if $file is of a type we can check
- * @param $file string
+ * @param string $file
* @return bool
*/
private function isSuitableFile( $file ) {
/**
* Add given path to file list, searching it in include path if needed
- * @param $path string
+ * @param string $path
* @return bool
*/
private function addPath( $path ) {
/**
* Add given file to file list, or, if it's a directory, add its content
- * @param $path string
+ * @param string $path
* @return bool
*/
private function addFileOrDir( $path ) {
/**
* Add all suitable files in given directory or its subdirectories to the file list
*
- * @param $dir String: directory to process
+ * @param string $dir Directory to process
*/
private function addDirectoryContent( $dir ) {
$iterator = new RecursiveIteratorIterator(
/**
* Check a file for syntax errors using Parsekit. Shamelessly stolen
* from tools/lint.php by TimStarling
- * @param $file String Path to a file to check for syntax errors
- * @return boolean
+ * @param string $file Path to a file to check for syntax errors
+ * @return bool
*/
private function checkFileWithParsekit( $file ) {
static $okErrors = array(
/**
* Check a file for syntax errors using php -l
- * @param $file String Path to a file to check for syntax errors
- * @return boolean
+ * @param string $file Path to a file to check for syntax errors
+ * @return bool
*/
private function checkFileWithCli( $file ) {
$res = exec( 'php -l ' . wfEscapeShellArg( $file ) );
* Check a file for non-fatal coding errors, such as byte-order marks in the beginning
* or pointless ?> closing tags at the end.
*
- * @param $file String String Path to a file to check for errors
- * @return boolean
+ * @param string $file String Path to a file to check for errors
+ * @return bool
*/
private function checkForMistakes( $file ) {
foreach ( $this->mNoStyleCheckPaths as $regex ) {
}
/**
- * @param $name string
+ * @param string $name
*/
private function killRow( $name ) {
if ( $this->dryrun ) {
/**
* Callback function for each revision, parse with both parsers and compare
- * @param $rev Revision
+ * @param Revision $rev
*/
public function processRevision( $rev ) {
$title = $rev->getTitle();
}
/**
- * @param $res
- * @param $dbw DatabaseBase
+ * @param ResultWrapper $res
+ * @param DatabaseBase $dbw
* @return null|int
*/
function convertOptionBatch( $res, $dbw ) {
* @ingroup Maintenance
*/
class CopyFileBackend extends Maintenance {
- /** @var Array|null (path sha1 => stat) Pre-computed dst stat entries from listings */
+ /** @var array|null (path sha1 => stat) Pre-computed dst stat entries from listings */
protected $statCache = null;
public function __construct() {
/**
* Perform the delete on archived revisions.
- * @param $maint Object An object (typically of class Maintenance)
+ * @param object $maint An object (typically of class Maintenance)
* that implements two methods: handleOutput() and
* purgeRedundantText(). See Maintenance for a description of
* those methods.
* Delete one or more revisions from the database
* Do this inside a transaction
*
- * @param $id Array of revision id values
- * @param $dbw DatabaseBase class (needs to be a master)
+ * @param array $id Array of revision id values
+ * @param DatabaseBase $dbw DatabaseBase class (needs to be a master)
*/
private function deleteRevs( $id, &$dbw ) {
if ( !is_array( $id ) ) {
/**
* Callback function for each revision, child classes should override
* processRevision instead.
- * @param $rev Revision
+ * @param DatabaseBase $rev
*/
public function handleRevision( $rev ) {
$title = $rev->getTitle();
}
/**
- * @param $rev Revision
+ * @param Revision $rev
*/
public function processRevision( $rev ) {
if ( preg_match( $this->getOption( 'regex' ), $rev->getContent()->getTextForSearchIndex() ) ) {
/**
* Fetch a list of used images from a particular image source.
*
- * @param $shared Boolean: true to pass shared-dir settings to hash func
+ * @param bool $shared True to pass shared-dir settings to hash func
*/
function fetchUsed( $shared ) {
$dbr = wfGetDB( DB_SLAVE );
/**
* Fetch a list of all images from a particular image source.
*
- * @param $shared Boolean: true to pass shared-dir settings to hash func
+ * @param bool $shared True to pass shared-dir settings to hash func
*/
function fetchLocal( $shared ) {
$dbr = wfGetDB( DB_SLAVE );
/**
* May throw a database error if, say, the server dies during query.
- * @param $db DatabaseBase object
- * @param $id int The old_id
- * @return String
+ * @param DatabaseBase $db
+ * @param int $id The old_id
+ * @return string
*/
private function doGetText( $db, $id ) {
$id = intval( $id );
/**
* Get hooks from a local file (for example docs/hooks.txt)
- * @param $doc string: filename to look in
- * @return array of documented hooks
+ * @param string $doc filename to look in
+ * @return array Array of documented hooks
*/
private function getHooksFromLocalDoc( $doc ) {
$m = array();
/**
* Get hooks from a PHP file
- * @param $file string Full filename to the PHP file.
+ * @param string $file Full filename to the PHP file.
* @return array of hooks found.
*/
private function getHooksFromFile( $file ) {
/**
* Get hooks from the source code.
- * @param $path Directory where the include files can be found
- * @return array of hooks found.
+ * @param string $path Directory where the include files can be found
+ * @return array Array of hooks found.
*/
private function getHooksFromPath( $path ) {
$hooks = array();
/**
* Get bad hooks (where the hook name could not be determined) from a PHP file
- * @param $file string Full filename to the PHP file.
- * @return array of bad wfRunHooks() lines
+ * @param string $file Full filename to the PHP file.
+ * @return array Array of bad wfRunHooks() lines
*/
private function getBadHooksFromFile( $file ) {
$content = file_get_contents( $file );
/**
* Get bad hooks from the source code.
- * @param $path Directory where the include files can be found
- * @return array of bad wfRunHooks() lines
+ * @param string $path Directory where the include files can be found
+ * @return array Array of bad wfRunHooks() lines
*/
private function getBadHooksFromPath( $path ) {
$hooks = array();
/**
* Nicely output the array
- * @param $msg String: a message to show before the value
- * @param $arr Array: an array
- * @param $sort Boolean: whether to sort the array (Default: true)
+ * @param string $msg A message to show before the value
+ * @param array $arr
+ * @param bool $sort Whether to sort the array (Default: true)
*/
private function printArray( $msg, $arr, $sort = true ) {
if ( $sort ) {
/**
* Fix a broken page entry
- * @param $pageID int The page_id to fix
+ * @param int $pageID The page_id to fix
*/
private function desyncFixPage( $pageID ) {
# Check for a corrupted page_latest
/**
* Get an array of author names from a documentation comment containing @author declarations.
* @param string $comment Documentation comment
- * @return Array of author names (strings)
+ * @return array Array of author names (strings)
*/
protected function getAuthorsFromComment( $comment ) {
$matches = null;
/**
* Create directory if it does not exist and return pathname with a trailing slash
- * @param $fspath string
+ * @param string $fspath
* @return null|string
*/
private static function init_path( $fspath ) {
/**
* Get the priority of a given namespace
*
- * @param $namespace Integer: the namespace to get the priority for
- * @return String
+ * @param int $namespace The namespace to get the priority for
+ * @return string
*/
function priority( $namespace ) {
return isset( $this->priorities[$namespace] ) ? $this->priorities[$namespace] : $this->guessPriority( $namespace );
* default priority for the namespace, varies depending on whether it's
* a talkpage or not.
*
- * @param $namespace Integer: the namespace to get the priority for
- * @return String
+ * @param int $namespace The namespace to get the priority for
+ * @return string
*/
function guessPriority( $namespace ) {
return MWNamespace::isSubject( $namespace ) ? $this->priorities[self::GS_MAIN] : $this->priorities[self::GS_TALK];
/**
* Return a database resolution of all the pages in a given namespace
*
- * @param $namespace Integer: limit the query to this namespace
+ * @param int $namespace Limit the query to this namespace
* @return Resource
*/
function getPageRes( $namespace ) {
/**
* gzopen() / fopen() wrapper
*
- * @return Resource
+ * @param string $file
+ * @param string $flags
+ * @return resource
*/
function open( $file, $flags ) {
$resource = $this->compress ? gzopen( $file, $flags ) : fopen( $file, $flags );
/**
* gzwrite() / fwrite() wrapper
+ *
+ * @param resource $handle
+ * @param string $str
*/
function write( &$handle, $str ) {
if ( $handle === true || $handle === false ) {
/**
* gzclose() / fclose() wrapper
+ *
+ * @param resource $handle
*/
function close( &$handle ) {
if ( $this->compress ) {
/**
* Get a sitemap filename
*
- * @param $namespace Integer: the namespace
- * @param $count Integer: the count
- * @return String
+ * @param int $namespace The namespace
+ * @param int $count The count
+ * @return string
*/
function sitemapFilename( $namespace, $count ) {
$ext = $this->compress ? '.gz' : '';
/**
* Return the XML schema being used
*
- * @return String
+ * @return string
*/
function xmlSchema() {
return 'http://www.sitemaps.org/schemas/sitemap/0.9';
/**
* Return the XML required to open a sitemap index file
*
- * @return String
+ * @return string
*/
function openIndex() {
return $this->xmlHead() . '<sitemapindex xmlns="' . $this->xmlSchema() . '">' . "\n";
/**
* Return the XML for a single sitemap indexfile entry
*
- * @param $filename String: the filename of the sitemap file
- * @return String
+ * @param string $filename The filename of the sitemap file
+ * @return string
*/
function indexEntry( $filename ) {
return
/**
* Return the XML required to close a sitemap index file
*
- * @return String
+ * @return string
*/
function closeIndex() {
return "</sitemapindex>\n";
/**
* Return the XML required to open a sitemap file
*
- * @return String
+ * @return string
*/
function openFile() {
return $this->xmlHead() . '<urlset xmlns="' . $this->xmlSchema() . '">' . "\n";
/**
* Return the XML for a single sitemap entry
*
- * @param $url String: an RFC 2396 compliant URL
- * @param $date String: a ISO 8601 date
- * @param $priority String: a priority indicator, 0.0 - 1.0 inclusive with a 0.1 stepsize
- * @return String
+ * @param string $url An RFC 2396 compliant URL
+ * @param string $date A ISO 8601 date
+ * @param string $priority A priority indicator, 0.0 - 1.0 inclusive with a 0.1 stepsize
+ * @return string
*/
function fileEntry( $url, $date, $priority ) {
return
/**
* Return the XML required to close sitemap file
*
- * @return String
+ * @return string
*/
function closeFile() {
return "</urlset>\n";
/**
* Populate $this->limit
+ *
+ * @param int $namespace
*/
function generateLimit( $namespace ) {
// bug 17961: make a title with the longest possible URL in this namespace
}
/**
- * @param $obj Title|Revision
+ * @param Title|Revision $obj
* @return bool
*/
private function skippedNamespace( $obj ) {
}
/**
- * @param $rev Revision
- * @return mixed
+ * @param Revision $rev
*/
function handleRevision( $rev ) {
$title = $rev->getTitle();
}
/**
- * @param $revision Revision
+ * @param Revision $revision
* @return bool
*/
function handleUpload( $revision ) {
/**
* Search a directory for files with one of a set of extensions
*
- * @param $dir string Path to directory to search
- * @param $exts Array of extensions to search for
- * @param $recurse Bool Search subdirectories recursively
- * @return mixed Array of filenames on success, or false on failure
+ * @param string $dir Path to directory to search
+ * @param array $exts Array of extensions to search for
+ * @param bool $recurse Search subdirectories recursively
+ * @return array|bool Array of filenames on success, or false on failure
*/
function findFiles( $dir, $exts, $recurse = false ) {
if ( is_dir( $dir ) ) {
/**
* Split a filename into filename and extension
*
- * @param $filename string Filename
+ * @param string $filename Filename
* @return array
*/
function splitFilename( $filename ) {
* files for acme.foo.bar and the extension ".txt". With $maxStrip = 2,
* acme.txt would also be acceptable.
*
- * @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
+ * @param string $file Base path
+ * @param string $auxExtension The extension to be appended to the base path
+ * @param int $maxStrip The maximum number of extensions to strip from the base path (default: 1)
+ * @return string|bool
*/
function findAuxFile( $file, $auxExtension, $maxStrip = 1 ) {
if ( strpos( $auxExtension, '.' ) !== 0 ) {
/**
* Constructor.
- * @param $options array Options for script.
+ * @param array $options Options for script.
*/
public function __construct( array $options ) {
if ( isset( $options['help'] ) ) {
/**
* Get the checks that can easily be treated by non-speakers of the language.
- * @return Array A list of the easy checks.
+ * @return array A list of the easy checks.
*/
protected function easyChecks() {
return array(
/**
* Check a language.
- * @param $code string The language code.
+ * @param string $code The language code.
* @throws MWException
* @return array The results.
*/
/**
* Format a message key.
- * @param $key string The message key.
- * @param $code string The language code.
+ * @param string $key The message key.
+ * @param string $code The language code.
* @return string The formatted message key.
*/
protected function formatKey( $key, $code ) {
/**
* Constructor.
- * @param $options array Options for script.
- * @param $extension string The extension name (or names).
+ * @param array $options Options for script.
+ * @param string $extension The extension name (or names).
*/
public function __construct( array $options, $extension ) {
if ( isset( $options['help'] ) ) {
/**
* Get the checks that can easily be treated by non-speakers of the language.
- * @return arrayA list of the easy checks.
+ * @return array A list of the easy checks.
*/
protected function easyChecks() {
return array(
/**
* Check a language and show the results.
- * @param $code string The language code.
+ * @param string $code The language code.
* @throws MWException
*/
protected function checkLanguage( $code ) {
* Load the list of languages: all the Messages*.php
* files in the languages directory.
*
- * @param $exif bool Treat the Exif messages?
+ * @param bool $exif Treat the Exif messages?
*/
function __construct( $exif = true ) {
require __DIR__ . '/messageTypes.inc';
/**
* Load the language file.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*/
protected function loadFile( $code ) {
if ( isset( $this->mRawMessages[$code] ) &&
* translated - messages which are either required or optional, but translated from
* English and needed.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*/
private function loadMessages( $code ) {
if ( isset( $this->mMessages[$code] ) ) {
* translated - messages which are either required or optional, but translated from
* English and needed.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return string The messages in this language.
*/
/**
* Get fallback language code for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return string Fallback code.
*/
/**
* Get namespace names for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array Namespace names.
*/
/**
* Get namespace aliases for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array Namespace aliases.
*/
/**
* Get magic words for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array Magic words.
*/
/**
* Get special page aliases for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array Special page aliases.
*/
/**
* Get the untranslated messages for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The untranslated messages for this language.
*/
/**
* Get the duplicate messages for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The duplicate messages for this language.
*/
/**
* Get the obsolete messages for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The obsolete messages for this language.
*/
/**
* Get the messages whose variables do not match the original ones.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages whose variables do not match the original ones.
*/
/**
* Get the messages which do not use plural.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages which do not use plural in this language.
*/
/**
* Get the empty messages.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The empty messages for this language.
*/
/**
* Get the messages with trailing whitespace.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages with trailing whitespace in this language.
*/
/**
* Get the non-XHTML messages.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The non-XHTML messages for this language.
*/
/**
* Get the messages which include wrong characters.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages which include wrong characters in this language.
*/
/**
* Get the messages which include dubious links.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages which include dubious links in this language.
*/
/**
* Get the messages which include unbalanced brackets.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages which include unbalanced brackets in this language.
*/
/**
* Get the untranslated namespace names.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The untranslated namespace names in this language.
*/
/**
* Get the project talk namespace names with no $1.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The problematic project talk namespaces in this language.
*/
/**
* Get the untranslated magic words.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The untranslated magic words in this language.
*/
/**
* Get the obsolete magic words.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The obsolete magic words in this language.
*/
/**
* Get the magic words that override the original English magic word.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The overriding magic words in this language.
*/
/**
* Get the magic words which do not match the case-sensitivity of the original words.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The magic words whose case does not match in this language.
*/
/**
* Get the untranslated special page names.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The untranslated special page names in this language.
*/
/**
* Get the obsolete special page names.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The obsolete special page names in this language.
*/
/**
* Load the messages group.
- * @param $group MessageGroup The messages group.
+ * @param MessageGroup $group The messages group.
*/
function __construct( MessageGroup $group ) {
$this->mMessageGroup = $group;
/**
* Load the language file.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*/
protected function loadFile( $code ) {
if ( !isset( $this->mRawMessages[$code] ) ) {
/**
* Rewrite a messages array.
*
- * @param $languages
- * @param $code string The language code.
+ * @param Languages $languages
+ * @param string $code 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 string The source file intended to remove from the array.
- * @param $messagesFolder String: path to a folder to store the MediaWiki messages.
+ * @param string $dupeMsgSource The source file intended to remove from the array.
+ * @param string $messagesFolder Path to a folder to store the MediaWiki messages.
*/
function rebuildLanguage( $languages, $code, $write, $listUnknown, $removeUnknown,
$removeDupes, $dupeMsgSource, $messagesFolder
/**
* Remove duplicates from a message array.
*
- * @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.
+ * @param array $oldMsgArray The input message array.
+ * @param string $dupeMsgSource The source file path for duplicates.
+ * @return array The output message array, with duplicates removed.
*/
function removeDupes( $oldMsgArray, $dupeMsgSource ) {
if ( file_exists( $dupeMsgSource ) ) {
/**
* Write a messages array as a PHP text and write it to the messages file.
*
- * @param $messages Array: the messages array.
- * @param $code String: the language code.
- * @param $write Boolean: write to the messages file?
- * @param $listUnknown Boolean: list the unknown messages?
- * @param $removeUnknown Boolean: whether to remove unkown messages
- * @param $messagesFolder String: path to a folder to store the MediaWiki messages.
- * Defaults to the current install.
+ * @param array $messages The messages array.
+ * @param string $code The language code.
+ * @param bool $write Write to the messages file?
+ * @param bool $listUnknown List the unknown messages?
+ * @param bool $removeUnknown Whether to remove unkown messages
+ * @param string $messagesFolder Path to a folder to store the MediaWiki messages.
+ * Defaults to the current install.
*/
public static function writeMessagesToFile( $messages, $code, $write, $listUnknown,
$removeUnknown, $messagesFolder = false
/**
* Write a messages array as a PHP text.
*
- * @param $messages Array: the messages array.
- * @param $ignoredComments Boolean: show comments about ignored and optional
- * messages? (For English.)
- * @param $prefix String: base path for messages.inc and messageTypes.inc files
- * or false for default path (this directory)
- * @param $removeUnknown Boolean: whether to remove unkown messages
+ * @param array $messages The messages array.
+ * @param bool $ignoredComments Show comments about ignored and optional
+ * messages? (For English.)
+ * @param string $prefix Base path for messages.inc and messageTypes.inc files
+ * or false for default path (this directory)
+ * @param bool $removeUnknown Whether to remove unkown messages
*
- * @return Array of the PHP text and the sorted messages array.
+ * @return array Array of the PHP text and the sorted messages array.
*/
public static function writeMessagesArray( $messages, $ignoredComments = false,
$prefix = false, $removeUnknown = false
/**
* Generates an array of comments for messages.
*
- * @param $messages Array: key of messages.
- * @param $ignored Array: list of ingored message keys.
- * @param $optional Array: list of optional message keys.
+ * @param array $messages Key of messages.
+ * @param array $ignored List of ingored message keys.
+ * @param array $optional List of optional message keys.
* @return array
*/
public static function makeComments( $messages, $ignored, $optional ) {
/**
* Write a block of messages to PHP.
*
- * @param $blockComment String: the comment of whole block.
- * @param $messages Array: the block messages.
- * @param $messageComments Array: optional comments for messages in this block.
- * @param $prefix String: prefix for every line, for indenting purposes.
+ * @param string $blockComment The comment of whole block.
+ * @param array $messages The block messages.
+ * @param array $messageComments Optional comments for messages in this block.
+ * @param string $prefix Prefix for every line, for indenting purposes.
*
* @return string The block, formatted in PHP.
*/
/**
* @todo Document
- * @param $fix Boolean: whether or not to fix broken entries
- * @param $suffix String: suffix to append to renamed articles
+ * @param bool $fix Whether or not to fix broken entries
+ * @param string $suffix Suffix to append to renamed articles
*
* @return bool
*/
/**
* Get the interwiki list
*
- * @return Array
+ * @return array
*/
private function getInterwikiList() {
$result = Interwiki::getAllPrefixes();
/**
* @todo Document
- * @param $ns Integer: a namespace id
- * @param $name String
- * @param $fix Boolean: whether to fix broken entries
- * @param $suffix String: suffix to append to renamed articles
+ * @param int $ns A namespace id
+ * @param string $name
+ * @param bool $fix Whether to fix broken entries
+ * @param string $suffix Suffix to append to renamed articles
* @return bool
*/
private function checkNamespace( $ns, $name, $fix, $suffix = '' ) {
/**
* @todo Do this for real
- * @param $key
- * @param $prefix
- * @param $fix
- * @param $suffix string
+ * @param int $ns
+ * @param string $name
+ * @param bool $fix
+ * @param string $suffix
* @return bool
*/
private function checkPrefix( $key, $prefix, $fix, $suffix = '' ) {
* Find pages in mainspace that have a prefix of the new namespace
* so we know titles that will need migrating
*
- * @param $ns Integer: namespace id (id for new namespace?)
- * @param $name String: prefix that is being made a namespace
+ * @param int $ns Namespace id (id for new namespace?)
+ * @param string $name Prefix that is being made a namespace
*
* @return array
*/
/**
* Report any conflicts we find
*
+ * @param stdClass $row
+ * @param string $suffix
* @return bool
*/
private function reportConflict( $row, $suffix ) {
/**
* Resolve any conflicts
*
- * @param $row Object: row from the page table to fix
- * @param $resolvable Boolean
- * @param $suffix String: suffix to append to the fixed page
+ * @param stClass $row Row from the page table to fix
+ * @param bool $resolvable
+ * @param string $suffix Suffix to append to the fixed page
* @return bool
*/
private function resolveConflict( $row, $resolvable, $suffix ) {
/**
* Resolve a given conflict
*
- * @param $row Object: row from the old broken entry
- * @param $table String: table to update
- * @param $prefix String: prefix for column name, like page or ar
+ * @param stdClass $row Row from the old broken entry
+ * @param string $table Table to update
+ * @param string $prefix Prefix for column name, like page or ar
* @return bool
*/
private function resolveConflictOn( $row, $table, $prefix ) {
/**
* Do all ready periodic jobs for all databases every 5 minutes (and .1% of the time)
- * @return integer
+ * @return int
*/
private function executeReadyPeriodicTasks() {
global $wgLocalDatabases, $wgMemc;
/**
* Lock the appropriate tables for the script
- * @param $db DatabaseBase object
- * @param $extraTable String The name of any extra tables to lock (eg: text)
+ * @param DatabaseBase $db
+ * @param string $extraTable The name of any extra tables to lock (eg: text)
*/
private function lockTables( $db, $extraTable = array() ) {
$tbls = array( 'page', 'revision', 'redirect' );
/**
* Check for orphan revisions
- * @param $fix bool Whether to fix broken revisions when found
+ * @param bool $fix Whether to fix broken revisions when found
*/
private function checkOrphans( $fix ) {
$dbw = wfGetDB( DB_MASTER );
}
/**
- * @param $fix bool
+ * @param bool $fix
* @todo DON'T USE THIS YET! It will remove entries which have children,
* but which aren't properly attached (eg if page_latest is bogus
* but valid revisions do exist)
/**
* Check for pages where page_latest is wrong
- * @param $fix bool Whether to fix broken entries
+ * @param bool $fix Whether to fix broken entries
*/
private function checkSeparation( $fix ) {
$dbw = wfGetDB( DB_MASTER );
}
/**
- * @param $row
+ * @param stdClass $row
* @param string $table
* @param string $idCol
* @param string $prefix
}
/**
- * @param $table string
- * @param $idCol
- * @param $prefix string
- * @return Integer Rows changed
+ * @param string $table
+ * @param string $idCol
+ * @param string $prefix
+ * @return int Rows changed
*/
protected function doSha1Updates( $table, $idCol, $prefix ) {
$db = $this->getDB( DB_MASTER );
}
/**
- * @param $row
- * @param $table
- * @param $idCol
- * @param $prefix
+ * @param stdClass $row
+ * @param string $table
+ * @param string $idCol
+ * @param string $prefix
* @return bool
*/
protected function upgradeRow( $row, $table, $idCol, $prefix ) {
}
/**
- * @param $row
+ * @param stdClass $row
* @return bool
*/
protected function upgradeLegacyArchiveRow( $row ) {
/**
* Callback function for each revision, preprocessToObj()
- * @param $rev Revision
+ * @param Revision $rev
*/
public function processRevision( $rev ) {
$content = $rev->getContent( Revision::RAW );
}
/**
- * @param $title Title
+ * @param Title $title
*/
function templateHook( $title ) {
$titleText = $title->getPrefixedDBkey();
}
/**
- * @param $dir string
- * @param $report string|bool Use 'report' to report the directories being scanned
+ * @param string $dir
+ * @param string|bool $report Use 'report' to report the directories being scanned
*/
protected function prune_directory( $dir, $report = false ) {
$tsNow = time();
/**
* Purge a namespace or all pages
+ *
+ * @param int|bool $namespace
*/
private function purgeNamespace( $namespace = false ) {
$dbr = wfGetDB( DB_SLAVE );
/**
* Helper to purge an array of $urls
- * @param $urls array List of URLS to purge from squids
+ * @param array $urls List of URLS to purge from squids
*/
private function sendPurgeRequest( $urls ) {
if ( $this->hasOption( 'delay' ) ) {
/**
* Reassign edits from one user to another
*
- * @param $from User to take edits from
- * @param $to User to assign edits to
- * @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
+ * @param User $from User to take edits from
+ * @param User $to User to assign edits to
+ * @param bool $rc Update the recent changes table
+ * @param bool $report Don't change things; just echo numbers
+ * @return int Number of entries changed, or that would be changed
*/
private function doReassignEdits( &$from, &$to, $rc = false, $report = false ) {
$dbw = wfGetDB( DB_MASTER );
* Return the most efficient set of user conditions
* i.e. a user => id mapping, or a user_text => text mapping
*
- * @param $user User for the condition
- * @param $idfield string Field name containing the identifier
- * @param $utfield string Field name containing the user text
+ * @param User $user User for the condition
+ * @param string $idfield Field name containing the identifier
+ * @param string $utfield Field name containing the user text
* @return array
*/
private function userConditions( &$user, $idfield, $utfield ) {
* Return user specifications
* i.e. user => id, user_text => text
*
- * @param $user User for the spec
- * @param $idfield string Field name containing the identifier
- * @param $utfield string Field name containing the user text
+ * @param User $user User for the spec
+ * @param string $idfield Field name containing the identifier
+ * @param string $utfield Field name containing the user text
* @return array
*/
private function userSpecification( &$user, $idfield, $utfield ) {
/**
* Initialise the user object
*
- * @param $username string Username or IP address
+ * @param string $username 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 array List of language codes to rebuild.
- * @param $lc LocalisationCache Instance of LocalisationCacheBulkLoad (?)
- * @param $force bool Rebuild up-to-date languages
+ * @param array $codes List of language codes to rebuild.
+ * @param LocalisationCache $lc Instance of LocalisationCacheBulkLoad (?)
+ * @param bool $force Rebuild up-to-date languages
* @return int Number of rebuilt languages
*/
private function doRebuild( $codes, $lc, $force ) {
}
/**
- * @param $dbw DatabaseBase
+ * @param DatabaseBase $dbw
* @return array
*/
function getConditions( $dbw ) {
}
/**
- * @param $force bool
- * @param $brokenOnly bool
+ * @param bool $force
+ * @param bool $brokenOnly
*/
function setupParameters( $force, $brokenOnly ) {
global $wgUpdateCompatibleMetadata;
/**
* Do the actual link refreshing.
- * @param $start int Page_id to start from
- * @param $newOnly bool Only do pages with 1 edit
- * @param $maxLag int Max DB replication lag
- * @param $end int Page_id to stop at
- * @param $redirectsOnly bool Only fix redirects
- * @param $oldRedirectsOnly bool Only fix redirects without redirect entries
+ * @param int $start Page_id to start from
+ * @param bool $newOnly Only do pages with 1 edit
+ * @param int $maxLag Max DB replication lag
+ * @param int $end Page_id to stop at
+ * @param bool $redirectsOnly Only fix redirects
+ * @param bool $oldRedirectsOnly Only fix redirects without redirect entries
*/
private function doRefreshLinks( $start, $newOnly = false, $maxLag = false,
$end = 0, $redirectsOnly = false, $oldRedirectsOnly = false ) {
* entry in the "redirect" table points to the correct page and not to an
* invalid one.
*
- * @param $id int The page ID to check
+ * @param int $id The page ID to check
*/
private function fixRedirect( $id ) {
$page = WikiPage::newFromID( $id );
/**
* Run LinksUpdate for all links on a given page_id
- * @param $id int The page_id
+ * @param int $id The page_id
*/
public static function fixLinksFromArticle( $id ) {
$page = WikiPage::newFromID( $id );
* Removes non-existing links from pages from pagelinks, imagelinks,
* categorylinks, templatelinks, externallinks, interwikilinks, langlinks and redirect tables.
*
- * @param $maxLag int
- * @param $batchSize int The size of deletion batches
+ * @param int $maxLag
+ * @param int $batchSize The size of deletion batches
*
* @author Merlijn van Deen <valhallasw@arctus.nl>
*/
* Could the specified user account be deemed inactive?
* (No edits, no deleted edits, no log entries, no current/old uploads)
*
- * @param $id User's ID
- * @param $master bool Perform checking on the master
+ * @param int $id User's ID
+ * @param bool $master Perform checking on the master
* @return bool
*/
private function isInactiveAccount( $id, $master = false ) {
/**
* Callback function for each revision, turn into HTML and save
- * @param $rev Revision
+ * @param Revision $rev
*/
public function handleRevision( $rev ) {
$title = $rev->getTitle();
/**
* Get all pages that should be rolled back for a given user
- * @param $user String a name to check against rev_user_text
+ * @param string $user A name to check against rev_user_text
* @return array
*/
private function getRollbackTitles( $user ) {
/**
* @param Job $job
- * @return integer Seconds for this runner to avoid doing more jobs of this type
+ * @return int Seconds for this runner to avoid doing more jobs of this type
* @see $wgJobBackoffThrottling
*/
private function getBackoffTimeToWait( Job $job ) {
/**
* Log the job message
- * @param $msg String The message to log
+ * @param string $msg The message to log
*/
private function runJobsLog( $msg ) {
$this->output( wfTimestamp( TS_DB ) . " $msg\n" );
/**
* Print the results, callback for $db->sourceStream()
- * @param $res ResultWrapper The results object
- * @param $db DatabaseBase object
+ * @param ResultWrapper $res The results object
+ * @param DatabaseBase $db object
*/
public function sqlPrintResult( $res, $db ) {
if ( !$res ) {
* Checks given files for correctness of SQL syntax. MySQL DDL will be converted to
* SQLite-compatible during processing.
* Will throw exceptions on SQL errors
- * @param $files
+ * @param array|string $files
* @throws MWException
- * @return mixed true if no error or error string in case of errors
+ * @return string|bool true if no error or error string in case of errors
*/
public static function checkSqlSyntax( $files ) {
if ( !Sqlite::isPresent() ) {
/**
* @todo document
- * @param $row
- * @param $extdb
+ * @param stdClass $row
+ * @param string $extdb
* @return bool
*/
private function compressPage( $row, $extdb ) {
}
/**
- * @param $startId
- * @param $maxChunkSize
- * @param $beginDate
- * @param $endDate
- * @param $extdb string
- * @param $maxPageId bool|int
+ * @param int $startId
+ * @param int $maxChunkSize
+ * @param string $beginDate
+ * @param string $endDate
+ * @param string $extdb
+ * @param bool|int $maxPageId
* @return bool
*/
private function compressWithConcat( $startId, $maxChunkSize, $beginDate,
/**
* This is based on part of HistoryBlobStub::getText().
* Determine if the text can be retrieved from the row in the normal way.
- * @param $stub
- * @param $secondaryRow
+ * @param array $stub
+ * @param stdClass $secondaryRow
* @return bool
*/
function isUnbrokenStub( $stub, $secondaryRow ) {
/**
* Move tracked text in a given page
+ *
+ * @param int $pageId
*/
function doPage( $pageId ) {
$title = Title::newFromId( $pageId );
* without data loss.
*
* The transaction is kept short to reduce locking.
+ *
+ * @param int $textId
+ * @param string $url
*/
function moveTextRow( $textId, $url ) {
if ( $this->copyOnly ) {
*
* This function completes any moves that only have done bt_new_url. This
* can happen when the script is interrupted, or when --copy-only is used.
+ *
+ * @param array $conds
*/
function finishIncompleteMoves( $conds ) {
$dbr = wfGetDB( DB_SLAVE );
/**
* Gets a DB master connection for the given external cluster name
- * @param $cluster string
+ * @param string $cluster
* @return DatabaseBase
*/
function getExtDB( $cluster ) {
/**
* Move an orphan text_id to the new cluster
+ *
+ * @param array $textIds
*/
function doOrphanList( $textIds ) {
// Finish incomplete moves
/**
* Add text.
* Returns false if it's ready to commit.
- * @param $text string
- * @param $textId
+ * @param string $text
+ * @param int $textId
* @return bool
*/
function addItem( $text, $textId ) {
* Sync $dst backend to $src backend based on the $src logs given after $start.
* Returns the journal entry ID this advanced to and handled (inclusive).
*
- * @param $src FileBackend
- * @param $dst FileBackend
- * @param $start integer Starting journal position
- * @param $end integer Starting journal position
- * @param $callback Closure Callback to update any position file
- * @return integer|false Journal entry ID or false if there are none
+ * @param FileBackend $src
+ * @param FileBackend $dst
+ * @param int $start Starting journal position
+ * @param int $end Starting journal position
+ * @param Closure $callback Callback to update any position file
+ * @return int|bool Journal entry ID or false if there are none
*/
protected function syncBackends(
FileBackend $src, FileBackend $dst, $start, $end, Closure $callback
/**
* Sync particular files of backend $src to the corresponding $dst backend files
*
- * @param $paths Array
- * @param $src FileBackend
- * @param $dst FileBackend
+ * @param array $paths
+ * @param FileBackend $src
+ * @param FileBackend $dst
* @return Status
*/
protected function syncFileBatch( array $paths, FileBackend $src, FileBackend $dst ) {
/**
* Substitute the backend name of storage paths with that of a given one
*
- * @param $paths Array|string List of paths or single string path
- * @return Array|string
+ * @param array|string $paths List of paths or single string path
+ * @return array|string
*/
protected function replaceNamePaths( $paths, FileBackend $backend ) {
return preg_replace(
/**
* Return ANSI terminal escape code for changing text attribs/color
*
- * @param $color String: semicolon-separated list of attribute/color codes
- * @return String
+ * @param string $color Semicolon-separated list of attribute/color codes
+ * @return string
*/
public function color( $color ) {
global $wgCommandLineDarkBg;
/**
* Return ANSI terminal escape code for restoring default text attributes
*
- * @return String
+ * @return string
*/
public function reset() {
return $this->color( 0 );
/**
* Output some text via the output callback provided
- * @param $str String Text to print
+ * @param string $str Text to print
*/
private function out( $str ) {
call_user_func( $this->outputCallback, $str );
* not requested. (If doing resolution, edits may be reassigned.)
* Status information will be echo'd to stdout.
*
- * @param $doDelete bool: pass true to actually remove things
- * from the database; false to just check.
+ * @param bool $doDelete Pass true to actually remove things
+ * from the database; false to just check.
* @return bool
*/
function checkDupes( $doDelete = false ) {
* Examine user records for the given name. Try to see which record
* will be the one that actually gets used, then check remaining records
* for edits. If the dupes have no edits, we can safely remove them.
- * @param $name string
- * @param $doDelete bool
+ * @param string $name
+ * @param bool $doDelete
* @access private
*/
function examine( $name, $doDelete ) {
* Count the number of edits attributed to this user.
* Does not currently check log table or other things
* where it might show up...
- * @param $userid int
+ * @param int $userid
* @return int
* @access private
*/
}
/**
- * @param $from int
- * @param $to int
+ * @param int $from
+ * @param int $to
* @access private
*/
function reassignEdits( $from, $to ) {
/**
* Remove a user account line.
- * @param $userid int
+ * @param int $userid
* @access private
*/
function trimAccount( $userid ) {
/**
* This is used to check options. Only needed on construction
*
- * @param $opts array
- * @param $args array
+ * @param array $opts
+ * @param array $args
*
* @return bool
*/
/**
* load script options in the object
*
- * @param $opts array
- * @param $args array
+ * @param array $opts
+ * @param array $args
*
* @return bool
*/