/**
* URL to redirect to or false if none
- * @var string|false $mRedirectUrl
+ * @var string|bool $mRedirectUrl
*/
var $mRedirectUrl = false; // !<
* uses this method to retrieve page text from the database, so the function
* has to remain public for now.
*
- * @return string|bool string containing article contents, or false if null
+ * @return string|bool String containing article contents, or false if null
* @deprecated since 1.21, use WikiPage::getContent() instead
*/
function fetchContent() { #BC cruft!
* @param string $action The action= GET parameter
* @param ParserOutput|null $pOutput
* @return array The policy that should be set
- * TODO: actions other than 'view'
+ * @todo: actions other than 'view'
*/
public function getRobotPolicy( $action, $pOutput = null ) {
global $wgArticleRobotPolicies, $wgNamespaceRobotPolicies, $wgDefaultRobotPolicy;
* Converts a String robot policy into an associative array, to allow
* merging of several policies using array_merge().
* @param array|string $policy Returns empty array on null/false/'', transparent
- * to already-converted arrays, converts String.
+ * to already-converted arrays, converts string.
* @return array 'index' => \<indexpolicy\>, 'follow' => \<followpolicy\>
*/
public static function formatRobotPolicy( $policy ) {
* Update user information in the external authentication database.
* Return true if successful.
*
- * @param User $user User object.
+ * @param User $user
* @return bool
*/
public function updateExternalDB( $user ) {
* supports those.
*
* @param array $articles
- * @param array $articles_start_char
+ * @param string[] $articles_start_char
* @return string
* @private
*/
/**
* Format a list of articles chunked by letter in a bullet list.
* @param array $articles
- * @param array $articles_start_char
+ * @param string[] $articles_start_char
* @return string
* @private
*/
*
* Tries memcached first.
*
- * @return array Array of strings: tags
+ * @return string[] Array of strings: tags
*/
public static function listDefinedTags() {
// Caching...
* This function will return false on older PHPs.
*
* @since 1.21
- * @return string|false
+ * @return string|bool
*/
static function getICUVersion() {
return defined( 'INTL_ICU_VERSION' ) ? INTL_ICU_VERSION : false;
* currently in use, or false when it can't be determined.
*
* @since 1.21
- * @return string|false
+ * @return string|bool
*/
static function getUnicodeVersionForICU() {
$icuVersion = IcuCollation::getICUVersion();
* Wraps the TOC in a table and provides the hide/collapse javascript.
*
* @param string $toc Html of the Table Of Contents
- * @param string|Language|false $lang Language for the toc title, defaults to user language
+ * @param string|Language|bool $lang Language for the toc title, defaults to user language
* @return string Full html of the TOC
*/
public static function tocList( $toc, $lang = false ) {
* Returns the canonical (English) name for a given index
*
* @param int $index Namespace index
- * @return string|false If no canonical definition.
+ * @return string|bool If no canonical definition.
*/
public static function getCanonicalName( $index ) {
$nslist = self::getCanonicalNamespaces();
protected $cachedTimestamp = null;
/**
- * Wheter to show prev/next links
+ * Whether to show prev/next links
*/
protected $shownavigation = true;
*
* @param string $wiki
* @param array|string $settings A setting name or array of setting names
- * @return array|mixed Array if $settings is an array, otherwise the value
+ * @return mixed|mixed[] Array if $settings is an array, otherwise the value
* @throws MWException
* @since 1.21
*/
/**
* Set the "relevant" title
* @see self::getRelevantTitle()
- * @param Title $t Title object to use
+ * @param Title $t
*/
public function setRelevantTitle( $t ) {
$this->mRelevantTitle = $t;
/**
* Set the "relevant" user
* @see self::getRelevantUser()
- * @param User $u User object to use
+ * @param User $u
*/
public function setRelevantUser( $u ) {
$this->mRelevantUser = $u;
/**
* Get the host's IP address.
* Does not support IPv6 at present due to the lack of a convenient interface in PHP.
+ * @throws MWException
* @return string
*/
protected function getIP() {
* @param string $key The database key, which has underscores
* instead of spaces, possibly including namespace and
* interwiki prefixes
- * @return Title|null Title, or NULL on an error
+ * @return Title|null Title, or null on an error
*/
public static function newFromDBkey( $key ) {
$t = new Title();
*
* @param int $id The page_id corresponding to the Title to create
* @param int $flags Use Title::GAID_FOR_UPDATE to use master
- * @return Title|null The new object, or NULL on an error
+ * @return Title|null The new object, or null on an error
*/
public static function newFromID( $id, $flags = 0 ) {
$db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
/**
* Make an array of titles from an array of IDs
*
- * @param array $ids Array of IDs
- * @return array Array of Titles
+ * @param int[] $ids Array of IDs
+ * @return Title[] Array of Titles
*/
public static function newFromIDs( $ids ) {
if ( !count( $ids ) ) {
* @param string $title Database key form
* @param string $fragment The link fragment (after the "#")
* @param string $interwiki Interwiki prefix
- * @return Title The new object, or NULL on an error
+ * @return Title The new object, or null on an error
*/
public static function makeTitleSafe( $ns, $title, $fragment = '', $interwiki = '' ) {
if ( !MWNamespace::exists( $ns ) ) {
* have been resolved (up to $wgMaxRedirects times)
*
* @param string $text Text with possible redirect
- * @return array Array of Titles, with the destination last
+ * @return Title[] Array of Titles, with the destination last
* @deprecated since 1.21, use Content::getRedirectChain instead.
*/
public static function newFromRedirectArray( $text ) {
* Get the prefixed DB key associated with an ID
*
* @param int $id The page_id of the article
- * @return Title|null An object representing the article, or NULL if no such article was found
+ * @return Title|null An object representing the article, or null if no such article was found
*/
public static function nameOf( $id ) {
$dbr = wfGetDB( DB_SLAVE );
* Determine whether the object refers to a page within
* this project and is transcludable.
*
- * @return bool TRUE if this is transcludable
+ * @return bool True if this is transcludable
*/
public function isTrans() {
if ( !$this->isExternal() ) {
* @param array $options May be FOR UPDATE
* @param string $table Table name
* @param string $prefix Fields prefix
- * @return array Array of Title objects linking here
+ * @return Title[] Array of Title objects linking here
*/
public function getLinksTo( $options = array(), $table = 'pagelinks', $prefix = 'pl' ) {
if ( count( $options ) > 0 ) {
* On heavily-used templates it will max out the memory.
*
* @param array $options May be FOR UPDATE
- * @return array Array of Title the Title objects linking here
+ * @return Title[] Array of Title the Title objects linking here
*/
public function getTemplateLinksTo( $options = array() ) {
return $this->getLinksTo( $options, 'templatelinks', 'tl' );
* On heavily-used templates it will max out the memory.
*
* @param array $options May be FOR UPDATE
- * @return array Array of Title the Title objects used here
+ * @return Title[] Array of Title the Title objects used here
*/
public function getTemplateLinksFrom( $options = array() ) {
return $this->getLinksFrom( $options, 'templatelinks', 'tl' );
* Get an array of Title objects referring to non-existent articles linked from this page
*
* @todo check if needed (used only in SpecialBrokenRedirects.php, and should use redirect table in this case)
- * @return array Array of Title the Title objects
+ * @return Title[] Array of Title the Title objects
*/
public function getBrokenLinksFrom() {
if ( $this->getArticleID() == 0 ) {
* Get a list of URLs to purge from the Squid cache when this
* page changes
*
- * @return array Array of String the URLs
+ * @return string[] Array of String the URLs
*/
public function getSquidURLs() {
$urls = array(
*
* @param int $revId Revision ID. Get the revision that was before this one.
* @param int $flags Title::GAID_FOR_UPDATE
- * @return int|bool Old revision ID, or FALSE if none exists
+ * @return int|bool Old revision ID, or false if none exists
*/
public function getPreviousRevisionID( $revId, $flags = 0 ) {
$db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
*
* @param int $revId Revision ID. Get the revision that was after this one.
* @param int $flags Title::GAID_FOR_UPDATE
- * @return int|bool Next revision ID, or FALSE if none exists
+ * @return int|bool Next revision ID, or false if none exists
*/
public function getNextRevisionID( $revId, $flags = 0 ) {
$db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
/**
* Get all extant redirects to this Title
*
- * @param int|null $ns Single namespace to consider; NULL to consider all namespaces
+ * @param int|null $ns Single namespace to consider; null to consider all namespaces
* @return Title[] Array of Title redirects to this title
*/
public function getRedirectsHere( $ns = null ) {
/**
* Same as sendPersonalised but does impersonal mail suitable for bulk
* mailing. Takes an array of MailAddress objects.
- * @param array $addresses
+ * @param MailAddress[] $addresses
* @return Status|null
*/
function sendImpersonal( $addresses ) {
/**
* Get the notification timestamp of this entry.
*
- * @return false|null|string false if the page is not watched, the value of
+ * @return bool|null|string False if the page is not watched, the value of
* the wl_notificationtimestamp field otherwise
*/
public function getNotificationTimestamp() {
* selected by a drop-down menu). For freeform input, see getText().
*
* @param string $name
- * @param string $default Optional default (or NULL)
+ * @param string $default Optional default (or null)
* @return string
*/
public function getVal( $name, $default = null ) {
/**
* Fetch an array from the input or return $default if it's not set.
* If source was scalar, will return an array with a single element.
- * If no source and no default, returns NULL.
+ * If no source and no default, returns null.
*
* @param string $name
- * @param array $default Optional default (or NULL)
+ * @param array $default Optional default (or null)
* @return array
*/
public function getArray( $name, $default = null ) {
/**
* Fetch an array of integers, or return $default if it's not set.
* If source was scalar, will return an array with a single element.
- * If no source and no default, returns NULL.
+ * If no source and no default, returns null.
* If an array is returned, contents are guaranteed to be integers.
*
* @param string $name
- * @param array $default option default (or NULL)
+ * @param array $default Option default (or null)
* @return array Array of ints
*/
public function getIntArray( $name, $default = null ) {
* @param DatabaseBase $dbr
* @param array $conditions
* @param array $options
- * @return object|false Database result resource, or false on failure
+ * @return object|bool Database result resource, or false on failure
*/
protected function pageData( $dbr, $conditions, $options = array() ) {
$fields = self::selectFields();
* @param DatabaseBase $dbr
* @param Title $title
* @param array $options
- * @return object|false Database result resource, or false on failure
+ * @return object|bool Database result resource, or false on failure
*/
public function pageDataFromTitle( $dbr, $title, $options = array() ) {
return $this->pageData( $dbr, array(
* @param DatabaseBase $dbr
* @param int $id
* @param array $options
- * @return object|false Database result resource, or false on failure
+ * @return object|bool Database result resource, or false on failure
*/
public function pageDataFromId( $dbr, $id, $options = array() ) {
return $this->pageData( $dbr, array( 'page_id' => $id ), $options );
* Revision::RAW get the text regardless of permissions
* @param User $user User object to check for, only if FOR_THIS_USER is passed
* to the $audience parameter
- * @return string|false The text of the current revision
+ * @return string|bool The text of the current revision
* @deprecated since 1.21, getContent() should be used instead.
*/
public function getText( $audience = Revision::FOR_PUBLIC, User $user = null ) { // @todo deprecated, replace usage!
*
* @param string $element Element name
* @param array $attribs Name=>value pairs. Values will be escaped.
- * @param string $contents NULL to make an open tag only; '' for a contentless closed tag (default)
+ * @param string $contents Null to make an open tag only; '' for a contentless closed tag (default)
* @param bool $allowShortTag Whether '' in $contents will result in a contentless closed tag
* @return string
*/
*
* @param string $element
* @param array $attribs Name=>value pairs. Values will be escaped.
- * @param string $contents NULL to make an open tag only; '' for a contentless closed tag (default)
+ * @param string $contents Null to make an open tag only; '' for a contentless closed tag (default)
* @return string
*/
public static function elementClean( $element, $attribs = array(), $contents = '' ) {
* @param Page|WikiPage $page Page or WikiPage object to work on
* @param User $user User doing the action
* @param string $token delete token (same as edit token)
- * @param string|null $reason reason for the deletion. Autogenerated if NULL
+ * @param string|null $reason reason for the deletion. Autogenerated if null
* @return Status|array
*/
public static function delete( Page $page, User $user, $token, &$reason = null ) {
/**
* ChannelFeed doesn't give us a method to print errors in a friendly
* manner, so just punt errors to the default printer.
- * @return false
+ * @return bool
*/
public function canPrintErrors() {
return false;
/**
* @since 1.21
*
- * @return string|false The wikitext to include when another page includes this
+ * @return string|bool The wikitext to include when another page includes this
* content, or false if the content is not includable in a wikitext page.
*
* @todo Allow native handling, bypassing wikitext representation, like
*
* @note: this allows any text-based content to be transcluded as if it was wikitext.
*
- * @return string|false The raw text, or false if the conversion failed.
+ * @return string|bool The raw text, or false if the conversion failed.
*/
public function getWikitextForTransclusion() {
$wikitext = $this->convert( CONTENT_MODEL_WIKITEXT, 'lossy' );
}
/**
- * @return array|false (int, int)
+ * @return array|bool (int, int)
*/
protected function getCoordinates() {
$m = array();
/** @var Title Title we're updating */
private $title;
- /** @var Content|false Content of the page (not text) */
+ /** @var Content|bool Content of the page (not text) */
private $content;
/**
* Prompt the whole form to be wrapped in a "<fieldset>", with
* this text as its "<legend>" element.
*
- * @param string|false $legend HTML to go inside the "<legend>" element, or
+ * @param string|bool $legend HTML to go inside the "<legend>" element, or
* false for no <legend>
* Will be escaped
*
* Get list of languages file can be viewed in.
*
* @param File $file
- * @return array Array of language codes, or empty array if unsupported.
+ * @return string[] Array of language codes, or empty array if unsupported.
* @since 1.23
*/
public function getAvailableLanguages( File $file ) {
* type do not support alternative language renderings.
*
* @param File $file
- * @return string Language code or null if multi-language not supported for filetype.
+ * @return string|null Language code or null if multi-language not supported for filetype.
* @since 1.23
*/
public function getDefaultRenderLanguage( File $file ) {
/**
* Get the final extension of the thumbnail.
* Returns false for scripted transformations.
- * @return string|false
+ * @return string|bool
*/
public function getExtension() {
return $this->path ? FileBackend::extensionFromPath( $this->path ) : false;
}
/**
- * @return string|false The thumbnail URL
+ * @return string|bool The thumbnail URL
*/
public function getUrl() {
return $this->url;
* @param Closure $callback Callback method to be executed
* @param int $exptime Either an interval in seconds or a unix timestamp for expiry
* @param int $attempts The amount of times to attempt a merge in case of failure
- * @return bool Cuccess
+ * @return bool Success
*/
public function merge( $key, Closure $callback, $exptime = 0, $attempts = 10 ) {
return $this->mergeViaLock( $key, $callback, $exptime, $attempts );
* Get the initial time of the request, based either on $wgRequestTime or
* $wgRUstart. Will return null if not able to find data.
*
- * @param string|false $metric Metric to use, with the following possibilities:
+ * @param string|bool $metric Metric to use, with the following possibilities:
* - user: User CPU time (without system calls)
* - cpu: Total CPU time (user and system calls)
* - wall (or any other string): elapsed time
* Get the initial time of the request, based either on $wgRequestTime or
* $wgRUstart. Will return null if not able to find data.
*
- * @param string|false $metric Metric to use, with the following possibilities:
+ * @param string|bool $metric Metric to use, with the following possibilities:
* - user: User CPU time (without system calls)
* - cpu: Total CPU time (user and system calls)
* - wall (or any other string): elapsed time
/**
* Entry point : initialise variables and call subfunctions.
*
- * @param string $par becomes "FOO" when called like Special:Allpages/FOO (default NULL)
+ * @param string $par becomes "FOO" when called like Special:Allpages/FOO (default null)
*/
function execute( $par ) {
$request = $this->getRequest();
/**
* @param int $namespace Namespace (Default NS_MAIN)
- * @param string $from List all pages from this name (default FALSE)
- * @param string $to List all pages to this name (default FALSE)
- * @param bool $hideredirects Dont show redirects (default FALSE)
+ * @param string $from List all pages from this name (default false)
+ * @param string $to List all pages to this name (default false)
+ * @param bool $hideredirects Dont show redirects (default false)
*/
function showChunk( $namespace = NS_MAIN, $from = false, $to = false, $hideredirects = false ) {
$output = $this->getOutput();
/**
* @param int $ns The namespace of the article
* @param string $text The name of the article
- * @return array( int namespace, string dbkey, string pagename ) or NULL on error
+ * @return array( int namespace, string dbkey, string pagename ) or null on error
*/
protected function getNamespaceKeyAndText( $ns, $text ) {
if ( $text == '' ) {
/**
* @param int $namespace Default NS_MAIN
* @param string $prefix
- * @param string $from List all pages from this name (default FALSE)
+ * @param string $from List all pages from this name (default false)
*/
protected function showPrefixChunk( $namespace = NS_MAIN, $prefix, $from = null ) {
global $wgContLang;
* $wgAntivirusRequired may be used to deny upload if the scan fails.
*
* @param string $file Pathname to the temporary upload file
- * @return mixed False if not virus is found, NULL if the scan fails or is disabled,
+ * @return mixed False if not virus is found, null if the scan fails or is disabled,
* or a string containing feedback from the virus scanner if a virus was found.
* If textual feedback is missing but a virus was found, this function returns true.
*/
/**
* @throws MWException Failure to parse XML input
- * @return true
+ * @return bool
*/
function readDump( $input ) {
$this->buffer = "";
/**
* @covers SpecialSearch::load
* @dataProvider provideSearchOptionsTests
- * @param array $requested Request parameters. For example array( 'ns5' => true, 'ns6' => true). NULL to use default options.
- * @param array $userOptions User options to test with. For example array('searchNs5' => 1 );. NULL to use default options.
+ * @param array $requested Request parameters. For example array( 'ns5' => true, 'ns6' => true). Null to use default options.
+ * @param array $userOptions User options to test with. For example array('searchNs5' => 1 );. Null to use default options.
* @param string $expectedProfile An expected search profile name
* @param array $expectedNs Expected namespaces
*/
*
* @param string $name The name of the element to check for
* (e.g.: "mediawiki" for <mediawiki>...</mediawiki>)
- * @param string|false $text If string, check if it equals the elements text.
+ * @param string|bool $text If string, check if it equals the elements text.
* If false, ignore the element's text
* @param bool $skip_ws (optional) if true, skip past white spaces that trail the
* closing element.