assertRequiredOptions( self::CONSTRUCTOR_OPTIONS ); $this->options = $options; $this->hookContainer = $hookContainer; $this->blockPermissionCheckerFactory = $blockPermissionCheckerFactory; $this->blockUtils = $blockUtils; $this->blockStore = $blockStore; $this->blockRestrictionStore = $blockRestrictionStore; $this->logger = $logger; } /** * Create BlockUser * * @param string|UserIdentity $target Target of the block * @param User $performer Performer of the block * @param string $expiry Expiry of the block (timestamp or 'infinity') * @param string $reason Reason of the block * @param array $blockOptions Block options * @param array $blockRestrictions Block restrictions * @param array|null $tags Tags that should be assigned to the log entry * * @return BlockUser */ public function newBlockUser( $target, User $performer, string $expiry, string $reason = '', array $blockOptions = [], array $blockRestrictions = [], $tags = [] ) : BlockUser { if ( $tags === null ) { $tags = []; } return new BlockUser( $this->options, $this->blockRestrictionStore, $this->blockPermissionCheckerFactory, $this->blockUtils, $this->hookContainer, $this->blockStore, $this->logger, $target, $performer, $expiry, $reason, $blockOptions, $blockRestrictions, $tags ); } /** * @param User|string $target * @param User $performer * @param string $reason * @param string[] $tags * * @return UnblockUser */ public function newUnblockUser( $target, User $performer, string $reason, array $tags = [] ) : UnblockUser { return new UnblockUser( $this->blockPermissionCheckerFactory, $this->blockStore, $this->hookContainer, $target, $performer, $reason, $tags ); } }