Make unused variable optional in ChangesList::insertDiffHist
authoraude <aude.wiki@gmail.com>
Thu, 11 Feb 2016 14:40:42 +0000 (15:40 +0100)
committeraude <aude.wiki@gmail.com>
Thu, 11 Feb 2016 14:46:40 +0000 (15:46 +0100)
$unpatrolled is unused in the method, so make it optional,
and then uses of it can be removed.

I realize it would do no harm to remove it completely, even
if a few (2 that I know of) extensions still pass the variable
to the method, but think this is nicer way.

Change-Id: Idbe6f00e9eb40db6a28de76fca0aea7c17b75656

includes/changes/ChangesList.php
includes/changes/OldChangesList.php

index 73c7548..39dedd4 100644 (file)
@@ -316,9 +316,9 @@ class ChangesList extends ContextSource {
        /**
         * @param string $s HTML to update
         * @param RecentChange $rc
-        * @param bool $unpatrolled
+        * @param bool|null $unpatrolled Unused variable, since 1.27.
         */
-       public function insertDiffHist( &$s, &$rc, $unpatrolled ) {
+       public function insertDiffHist( &$s, &$rc, $unpatrolled = null ) {
                # Diff link
                if (
                        $rc->mAttribs['rc_type'] == RC_NEW ||
index 6f05dc4..2845c5c 100644 (file)
@@ -92,7 +92,7 @@ class OldChangesList extends ChangesList {
                        }
                // Regular entries
                } else {
-                       $this->insertDiffHist( $html, $rc, $unpatrolled );
+                       $this->insertDiffHist( $html, $rc );
                        # M, N, b and ! (minor, new, bot and unpatrolled)
                        $html .= $this->recentChangesFlags(
                                array(