Replace use of &$this
[lhc/web/wiklou.git] / includes / changes / RecentChange.php
index 1262f2c..772500f 100644 (file)
@@ -329,7 +329,9 @@ class RecentChange {
                $this->mAttribs['rc_id'] = $dbw->insertId();
 
                # Notify extensions
-               Hooks::run( 'RecentChange_save', [ &$this ] );
+               // Avoid PHP 7.1 warning from passing $this by reference
+               $rc = $this;
+               Hooks::run( 'RecentChange_save', [ &$rc ] );
 
                if ( count( $this->tags ) ) {
                        ChangeTags::addTags( $this->tags, $this->mAttribs['rc_id'],
@@ -451,6 +453,9 @@ class RecentChange {
                        throw new MWException( __FUNCTION__ . ": Unknown stream logger URI scheme: $scheme" );
                }
 
+               if ( defined( 'MW_PHPUNIT_TEST' ) && is_object( $wgRCEngines[$scheme] ) ) {
+                       return $wgRCEngines[$scheme];
+               }
                return new $wgRCEngines[$scheme];
        }
 
@@ -762,6 +767,7 @@ class RecentChange {
                # # Get pageStatus for email notification
                switch ( $type . '-' . $action ) {
                        case 'delete-delete':
+                       case 'delete-delete_redir':
                                $pageStatus = 'deleted';
                                break;
                        case 'move-move':