expiry = $expiry; $this->blockUserFactory = $blockUserFactory; $this->filterUser = $filterUser; } /** * Perform a block by the AbuseFilter system user * @param string $ruleDesc * @param int|string $ruleNumber * @param string $target * @param string $expiry * @param bool $isAutoBlock * @param bool $preventEditOwnUserTalk */ protected function doBlockInternal( string $ruleDesc, $ruleNumber, string $target, string $expiry, bool $isAutoBlock, bool $preventEditOwnUserTalk ) : void { $reason = wfMessage( 'abusefilter-blockreason', $ruleDesc, $ruleNumber )->inContentLanguage()->text(); $this->blockUserFactory->newBlockUser( $target, // TODO: Avoid User here (T266409) User::newFromIdentity( $this->filterUser->getUser() ), $expiry, $reason, [ 'isHardBlock' => false, 'isAutoblocking' => $isAutoBlock, 'isCreateAccountBlocked' => true, 'isUserTalkEditBlocked' => $preventEditOwnUserTalk ] )->placeBlockUnsafe(); } }