# Convert mAttribs['rc_user'] etc for ActorMigration
$user = User::newFromAnyId(
- isset( $row['rc_user'] ) ? $row['rc_user'] : null,
- isset( $row['rc_user_text'] ) ? $row['rc_user_text'] : null,
- isset( $row['rc_actor'] ) ? $row['rc_actor'] : null
+ $row['rc_user'] ?? null,
+ $row['rc_user_text'] ?? null,
+ $row['rc_actor'] ?? null
);
unset( $row['rc_user'], $row['rc_user_text'], $row['rc_actor'] );
$row += ActorMigration::newMigration()->getInsertValues( $dbw, 'rc_user', $user );
/**
* 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;
continue;
}
- if ( isset( $this->mExtra['actionCommentIRC'] ) ) {
- $actionComment = $this->mExtra['actionCommentIRC'];
- } else {
- $actionComment = null;
- }
+ $actionComment = $this->mExtra['actionCommentIRC'] ?? null;
$feed = RCFeed::factory( $params );
$feed->notify( $this, $actionComment );
*
* @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
*/
* '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()
*/
* Makes an entry in the database corresponding to an edit
*
* @param string $timestamp
- * @param Title &$title
+ * @param Title $title
* @param bool $minor
- * @param User &$user
+ * @param User $user
* @param string $comment
* @param int $oldId
* @param string $lastTimestamp
* @return RecentChange
*/
public static function notifyEdit(
- $timestamp, &$title, $minor, &$user, $comment, $oldId, $lastTimestamp,
+ $timestamp, $title, $minor, $user, $comment, $oldId, $lastTimestamp,
$bot, $ip = '', $oldSize = 0, $newSize = 0, $newId = 0, $patrol = 0,
$tags = []
) {
* Note: the title object must be loaded with the new id using resetArticleID()
*
* @param string $timestamp
- * @param Title &$title
+ * @param Title $title
* @param bool $minor
- * @param User &$user
+ * @param User $user
* @param string $comment
* @param bool $bot
* @param string $ip
* @return RecentChange
*/
public static function notifyNew(
- $timestamp, &$title, $minor, &$user, $comment, $bot,
+ $timestamp, $title, $minor, $user, $comment, $bot,
$ip = '', $size = 0, $newId = 0, $patrol = 0, $tags = []
) {
$rc = new RecentChange;
/**
* @param string $timestamp
- * @param Title &$title
- * @param User &$user
+ * @param Title $title
+ * @param User $user
* @param string $actionComment
* @param string $ip
* @param string $type
* @param string $actionCommentIRC
* @return bool
*/
- public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip, $type,
+ public static function notifyLog( $timestamp, $title, $user, $actionComment, $ip, $type,
$action, $target, $logComment, $params, $newId = 0, $actionCommentIRC = ''
) {
global $wgLogRestrictions;
/**
* @param string $timestamp
- * @param Title &$title
- * @param User &$user
+ * @param Title $title
+ * @param User $user
* @param string $actionComment
* @param string $ip
* @param string $type
* @param bool $isPatrollable Whether this log entry is patrollable
* @return RecentChange
*/
- public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip,
+ public static function newLogEntry( $timestamp, $title, $user, $actionComment, $ip,
$type, $action, $target, $logComment, $params, $newId = 0, $actionCommentIRC = '',
$revId = 0, $isPatrollable = false ) {
global $wgRequest;
*
* @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
* @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
*/
*/
public function getParam( $name ) {
$params = $this->parseParams();
- return isset( $params[$name] ) ? $params[$name] : null;
+ return $params[$name] ?? null;
}
/**
$this->mAttribs['rc_comment_data'] = null;
$user = User::newFromAnyId(
- isset( $this->mAttribs['rc_user'] ) ? $this->mAttribs['rc_user'] : null,
- isset( $this->mAttribs['rc_user_text'] ) ? $this->mAttribs['rc_user_text'] : null,
- isset( $this->mAttribs['rc_actor'] ) ? $this->mAttribs['rc_actor'] : null
+ $this->mAttribs['rc_user'] ?? null,
+ $this->mAttribs['rc_user_text'] ?? null,
+ $this->mAttribs['rc_actor'] ?? null
);
$this->mAttribs['rc_user'] = $user->getId();
$this->mAttribs['rc_user_text'] = $user->getName();
if ( $name === 'rc_user' || $name === 'rc_user_text' || $name === 'rc_actor' ) {
$user = User::newFromAnyId(
- isset( $this->mAttribs['rc_user'] ) ? $this->mAttribs['rc_user'] : null,
- isset( $this->mAttribs['rc_user_text'] ) ? $this->mAttribs['rc_user_text'] : null,
- isset( $this->mAttribs['rc_actor'] ) ? $this->mAttribs['rc_actor'] : null
+ $this->mAttribs['rc_user'] ?? null,
+ $this->mAttribs['rc_user_text'] ?? null,
+ $this->mAttribs['rc_actor'] ?? null
);
if ( $name === 'rc_user' ) {
return $user->getId();
}
}
- return isset( $this->mAttribs[$name] ) ? $this->mAttribs[$name] : null;
+ return $this->mAttribs[$name] ?? null;
}
/**