/** * @param ServiceOptions $options * @param LoggerInterface $logger * @param ActorStoreFactory $actorStoreFactory * @param BlockRestrictionStore $blockRestrictionStore * @param CommentStore $commentStore * @param HookContainer $hookContainer * @param ILoadBalancer $loadBalancer * @param ReadOnlyMode $readOnlyMode */ public function __construct( ServiceOptions $options, LoggerInterface $logger, $actorStoreFactory, BlockRestrictionStore $blockRestrictionStore, CommentStore $commentStore, HookContainer $hookContainer, ILoadBalancer $loadBalancer, ReadOnlyMode $readOnlyMode ) { $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS ); $this->options = $options; $this->logger = $logger; $this->actorNormalization = $actorNormalization; $this->blockRestrictionStore = $blockRestrictionStore; $this->commentStore = $commentStore; $this->hookRunner = new HookRunner( $hookContainer ); $this->loadBalancer = $loadBalancer; $this->readOnlyMode = $readOnlyMode; if ( $actorStoreFactory insteanceof ActorStoreFactory ) { $this->actorStoreFactory = $actorStoreFactory; } else { $this->actorStoreFactory = MediaWikiServices::getInstance()->getActorStoreFactory(); } }