X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2Fchanges%2FRecentChange.php;h=2d37eacdc038bbd51a47e3e99d241e44de18dcdb;hb=fd24be4fc537497531f1b1dad9c8bb7b6fb81ff0;hp=904090f88acaade4420585dfd44deba334217f31;hpb=1669047884543d3678825ac8d93b7381b5d0d79d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 904090f88a..2d37eacdc0 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -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' ); } @@ -490,7 +492,7 @@ class RecentChange { /** * Notify all the feeds about the change. - * @param array $feeds Optional feeds to send to, defaults to $wgRCFeeds + * @param array|null $feeds Optional feeds to send to, defaults to $wgRCFeeds */ public function notifyRCFeeds( array $feeds = null ) { global $wgRCFeeds; @@ -556,7 +558,7 @@ class RecentChange { * * @param RecentChange|int $change RecentChange or corresponding rc_id * @param bool $auto For automatic patrol - * @param string|string[] $tags Change tags to add to the patrol log entry + * @param string|string[]|null $tags Change tags to add to the patrol log entry * ($user should be able to add the specified tags before this is called) * @return array See doMarkPatrolled(), or null if $change is not an existing rc_id */ @@ -581,7 +583,7 @@ class RecentChange { * 'markedaspatrollederror-noautopatrol' as errors * @param User $user User object doing the action * @param bool $auto For automatic patrol - * @param string|string[] $tags Change tags to add to the patrol log entry + * @param string|string[]|null $tags Change tags to add to the patrol log entry * ($user should be able to add the specified tags before this is called) * @return array Array of permissions errors, see Title::getUserPermissionsErrors() */ @@ -932,7 +934,7 @@ class RecentChange { * * @param string $timestamp Timestamp of the recent change to occur * @param Title $categoryTitle Title of the category a page is being added to or removed from - * @param User $user User object of the user that made the change + * @param User|null $user User object of the user that made the change * @param string $comment Change summary * @param Title $pageTitle Title of the page that is being added or removed * @param int $oldRevId Parent revision ID of this change @@ -941,7 +943,7 @@ class RecentChange { * @param bool $bot true, if the change was made by a bot * @param string $ip IP address of the user, if the change was made anonymously * @param int $deleted Indicates whether the change has been deleted - * @param bool $added true, if the category was added, false for removed + * @param bool|null $added true, if the category was added, false for removed * * @return RecentChange */ @@ -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 ) ) {