Split part of EnhancedChangesList::recentChangesLine into new method
authoraude <aude.wiki@gmail.com>
Tue, 8 Apr 2014 08:40:04 +0000 (10:40 +0200)
committerAude <aude.wiki@gmail.com>
Tue, 8 Apr 2014 11:57:01 +0000 (11:57 +0000)
Change-Id: I57f22ac0969fe3ba324a2b9d107c6f2d9968769c

includes/changes/EnhancedChangesList.php

index feb6d7b..6c42601 100644 (file)
@@ -107,9 +107,20 @@ class EnhancedChangesList extends ChangesList {
                }
 
                $cacheEntry = $this->cacheEntryFactory->newFromRecentChange( $baseRC, $watched );
+               $this->addCacheEntry( $cacheEntry );
 
-               # Put accumulated information into the cache, for later display
-               # Page moves go on their own line
+               wfProfileOut( __METHOD__ );
+
+               return $ret;
+       }
+
+       /**
+        * Put accumulated information into the cache, for later display.
+        * Page moves go on their own line.
+        *
+        * @param RCCacheEntry $cacheEntry
+        */
+       protected function addCacheEntry( RCCacheEntry $cacheEntry ) {
                $title = $cacheEntry->getTitle();
                $secureName = $title->getPrefixedDBkey();
 
@@ -132,10 +143,6 @@ class EnhancedChangesList extends ChangesList {
 
                        array_push( $this->rc_cache[$secureName], $cacheEntry );
                }
-
-               wfProfileOut( __METHOD__ );
-
-               return $ret;
        }
 
        /**