Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/95945
Change subject: Update defaults for addGoodLinkObj() to int
......................................................................
Update defaults for addGoodLinkObj() to int
Update the defaults for $revision and $model from bool to int, making it
consistent with the documented input. Also update docs and line length.
Change-Id: Ic19a408aa7c50fb03e2c3aca8df3fa7cedc2420b
---
M includes/cache/LinkCache.php
M includes/cache/MessageCache.php
2 files changed, 19 insertions(+), 10 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/45/95945/1
diff --git a/includes/cache/LinkCache.php b/includes/cache/LinkCache.php
index 31d79f4..bffa4c8 100644
--- a/includes/cache/LinkCache.php
+++ b/includes/cache/LinkCache.php
@@ -123,14 +123,16 @@
/**
* Add a link for the title to the link cache
*
- * @param $id Integer: page's ID
- * @param $title Title object
- * @param $len Integer: text's length
- * @param $redir Integer: whether the page is a redirect
- * @param $revision Integer: latest revision's ID
- * @param $model Integer: latest revision's content model ID
+ * @param int $id Page's ID
+ * @param Title $title
+ * @param int $len Text's length
+ * @param int $redir Whether the page is a redirect
+ * @param int $revision Latest revision's ID
+ * @param int $model Latest revision's content model ID
*/
- public function addGoodLinkObj( $id, $title, $len = -1, $redir = null,
$revision = false, $model = false ) {
+ public function addGoodLinkObj( $id, $title, $len = -1, $redir = null,
+ $revision = 0, $model = 0
+ ) {
$dbkey = $title->getPrefixedDBkey();
$this->mGoodLinks[$dbkey] = intval( $id );
$this->mGoodLinkFields[$dbkey] = array(
diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index eff3ea7..8b52728 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -700,7 +700,8 @@
* "msg/lang".
*
* @throws MWException when given an invalid key
- * @return string|bool False if the message doesn't exist, otherwise
the message (which can be empty)
+ * @return string|bool False if the message doesn't exist, otherwise the
+ * message (which can be empty)
*/
function get( $key, $useDB = true, $langcode = true, $isFullKey = false
) {
global $wgContLang;
@@ -737,7 +738,12 @@
// Loop through each language in the fallback list until we
find something useful
$lang = wfGetLangObj( $langcode );
- $message = $this->getMessageFromFallbackChain( $lang, $lckey,
$uckey, !$this->mDisable && $useDB );
+ $message = $this->getMessageFromFallbackChain(
+ $lang,
+ $lckey,
+ $uckey,
+ !$this->mDisable && $useDB
+ );
// If we still have no message, maybe the key was in fact a
full key so try that
if ( $message === false ) {
@@ -815,7 +821,8 @@
return $message;
}
- list( $fallbackChain, $siteFallbackChain ) =
Language::getFallbacksIncludingSiteLanguage( $langcode );
+ list( $fallbackChain, $siteFallbackChain ) =
+ Language::getFallbacksIncludingSiteLanguage( $langcode
);
// Next try checking the database for all of the fallback
languages of the requested language.
if ( $useDB ) {
--
To view, visit https://gerrit.wikimedia.org/r/95945
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic19a408aa7c50fb03e2c3aca8df3fa7cedc2420b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits