Provide a Taggable interface
[lhc/web/wiklou.git] / includes / changes / RecentChange.php
index 819f170..2d37eac 100644 (file)
@@ -19,6 +19,7 @@
  *
  * @file
  */
+use MediaWiki\ChangeTags\Taggable;
 
 /**
  * Utility class for creating new RC entries
@@ -65,7 +66,7 @@
  *  we're having to include both rc_comment and rc_comment_text/rc_comment_data
  *  so random crap works right.
  */
-class RecentChange {
+class RecentChange implements Taggable {
        // Constants for the rc_source field.  Extensions may also have
        // their own source constants.
        const SRC_EDIT = 'mw.edit';
@@ -228,13 +229,14 @@ class RecentChange {
                global $wgActorTableSchemaMigrationStage;
 
                wfDeprecated( __METHOD__, '1.31' );
-               if ( $wgActorTableSchemaMigrationStage > MIGRATION_WRITE_BOTH ) {
+               if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW ) {
                        // If code is using this instead of self::getQueryInfo(), there's a
                        // decent chance it's going to try to directly access
                        // $row->rc_user or $row->rc_user_text and we can't give it
-                       // useful values here once those aren't being written anymore.
+                       // useful values here once those aren't being used anymore.
                        throw new BadMethodCallException(
-                               'Cannot use ' . __METHOD__ . ' when $wgActorTableSchemaMigrationStage > MIGRATION_WRITE_BOTH'
+                               'Cannot use ' . __METHOD__
+                                       . ' when $wgActorTableSchemaMigrationStage has SCHEMA_COMPAT_READ_NEW'
                        );
                }
 
@@ -1197,7 +1199,7 @@ class RecentChange {
         *
         * @since 1.28
         *
-        * @param string|array $tags
+        * @param string|string[] $tags
         */
        public function addTags( $tags ) {
                if ( is_string( $tags ) ) {