jenkins-bot has submitted this change and it was merged.

Change subject: Update LinkCache::addGoodLinkObj param defaults to int
......................................................................


Update LinkCache::addGoodLinkObj param defaults 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 "inval( $x )" to preferred "(int) $x" while changing the method.

Change-Id: Ic19a408aa7c50fb03e2c3aca8df3fa7cedc2420b
---
M includes/cache/LinkCache.php
1 file changed, 15 insertions(+), 12 deletions(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/cache/LinkCache.php b/includes/cache/LinkCache.php
index 31d79f4..0d706c0 100644
--- a/includes/cache/LinkCache.php
+++ b/includes/cache/LinkCache.php
@@ -123,21 +123,24 @@
        /**
         * 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->mGoodLinks[$dbkey] = (int)$id;
                $this->mGoodLinkFields[$dbkey] = array(
-                       'length' => intval( $len ),
-                       'redirect' => intval( $redir ),
-                       'revision' => intval( $revision ),
-                       'model' => intval( $model ) );
+                       'length' => (int)$len,
+                       'redirect' => (int)$redir,
+                       'revision' => (int)$revision,
+                       'model' => (int)$model
+               );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/95945
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic19a408aa7c50fb03e2c3aca8df3fa7cedc2420b
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to