Merge "Rewrite pref cleanup script"
[lhc/web/wiklou.git] / includes / changes / CategoryMembershipChange.php
index 5d19961..f095b64 100644 (file)
@@ -71,7 +71,7 @@ class CategoryMembershipChange {
                        $this->timestamp = $revision->getTimestamp();
                }
                $this->revision = $revision;
-               $this->newForCategorizationCallback = [ 'RecentChange', 'newForCategorization' ];
+               $this->newForCategorizationCallback = [ RecentChange::class, 'newForCategorization' ];
        }
 
        /**
@@ -134,7 +134,8 @@ class CategoryMembershipChange {
                        ),
                        $this->pageTitle,
                        $this->getPreviousRevisionTimestamp(),
-                       $this->revision
+                       $this->revision,
+                       $type === self::CATEGORY_ADDITION
                );
        }
 
@@ -146,6 +147,7 @@ class CategoryMembershipChange {
         * @param Title $pageTitle Title of the page that is being added or removed
         * @param string $lastTimestamp Parent revision timestamp of this change in TS_MW format
         * @param Revision|null $revision
+        * @param bool $added true, if the category was added, false for removed
         *
         * @throws MWException
         */
@@ -156,7 +158,8 @@ class CategoryMembershipChange {
                $comment,
                Title $pageTitle,
                $lastTimestamp,
-               $revision
+               $revision,
+               $added
        ) {
                $deleted = $revision ? $revision->getVisibility() & Revision::SUPPRESSED_USER : 0;
                $newRevId = $revision ? $revision->getId() : 0;
@@ -197,7 +200,8 @@ class CategoryMembershipChange {
                                $lastTimestamp,
                                $bot,
                                $ip,
-                               $deleted
+                               $deleted,
+                               $added
                        ]
                );
                $rc->save();