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

Change subject: Add recentChangesLine to ChangesList
......................................................................


Add recentChangesLine to ChangesList

This method is implemented in all sub classes.

Not having this method here looks odd as
ChangesList::newFromContext returns a ChangesList
and parts of the code base then call recentChangesLine
on that object which may not exist..

In the future we might even have some interface here?

Change-Id: Iad00a956862c078a2bcaf3ef0602abcf3fedb7d2
---
M includes/changes/ChangesList.php
M includes/changes/EnhancedChangesList.php
2 files changed, 20 insertions(+), 4 deletions(-)

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



diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php
index fdc9944..01f10d8 100644
--- a/includes/changes/ChangesList.php
+++ b/includes/changes/ChangesList.php
@@ -77,6 +77,21 @@
        }
 
        /**
+        * Format a line
+        *
+        * @since 1.27
+        *
+        * @param RecentChange $rc Passed by reference
+        * @param bool $watched (default false)
+        * @param int $linenumber (default null)
+        *
+        * @return string|bool
+        */
+       public function recentChangesLine( &$rc, $watched = false, $linenumber 
= null ) {
+               throw new RuntimeException( 'recentChangesLine should be 
implemented' );
+       }
+
+       /**
         * Sets the list to use a "<li class='watchlist-(namespace)-(page)'>" 
tag
         * @param bool $value
         */
diff --git a/includes/changes/EnhancedChangesList.php 
b/includes/changes/EnhancedChangesList.php
index 1dcb7ae..f10307d 100644
--- a/includes/changes/EnhancedChangesList.php
+++ b/includes/changes/EnhancedChangesList.php
@@ -83,15 +83,16 @@
        /**
         * Format a line for enhanced recentchange (aka with javascript and 
block of lines).
         *
-        * @param RecentChange $baseRC
+        * @param RecentChange $rc
         * @param bool $watched
+        * @param int $linenumber (default null)
         *
         * @return string
         */
-       public function recentChangesLine( &$baseRC, $watched = false ) {
+       public function recentChangesLine( &$rc, $watched = false, $linenumber 
= null ) {
 
                $date = $this->getLanguage()->userDate(
-                       $baseRC->mAttribs['rc_timestamp'],
+                       $rc->mAttribs['rc_timestamp'],
                        $this->getUser()
                );
 
@@ -106,7 +107,7 @@
                        $this->lastdate = $date;
                }
 
-               $cacheEntry = $this->cacheEntryFactory->newFromRecentChange( 
$baseRC, $watched );
+               $cacheEntry = $this->cacheEntryFactory->newFromRecentChange( 
$rc, $watched );
                $this->addCacheEntry( $cacheEntry );
 
                return $ret;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iad00a956862c078a2bcaf3ef0602abcf3fedb7d2
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to