assertRequiredOptions( self::CONSTRUCTOR_OPTIONS ); $this->options = $options; $this->actorStoreFactory = $actorStoreFactory; $this->userNameUtils = $userNameUtils; $this->loadBalancerFactory = $loadBalancerFactory; } /** * @param string|false $wikiId * @return BlockUtils */ public function getBlockUtils( $wikiId = Block::LOCAL ): BlockUtils { if ( is_string( $wikiId ) && $this->loadBalancerFactory->getLocalDomainID() === $wikiId ) { $wikiId = Block::LOCAL; } $storeCacheKey = $wikiId === Block::LOCAL ? 'LOCAL' : 'crosswikistore-' . $wikiId; if ( !isset( $this->storeCache[$storeCacheKey] ) ) { $this->storeCache[$storeCacheKey] = new BlockUtils( $this->options, $this->actorStoreFactory->getUserIdentityLookup( $wikiId ), $this->userNameUtils, $wikiId ); } return $this->storeCache[$storeCacheKey]; } }