mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-30 18:45:07 +00:00
8f44150300
Change-Id: I57b56d285bac4b41e81f656f3c1ddceee4620fb5
59 lines
1.7 KiB
PHP
59 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Notifications;
|
|
|
|
use MediaWiki\Extension\Notifications\Cache\RevisionLocalCache;
|
|
use MediaWiki\Extension\Notifications\Cache\TitleLocalCache;
|
|
use MediaWiki\Extension\Notifications\Push\NotificationServiceClient;
|
|
use MediaWiki\Extension\Notifications\Push\SubscriptionManager;
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
class Services {
|
|
|
|
/** @var MediaWikiServices */
|
|
private $services;
|
|
|
|
/** @return Services */
|
|
public static function getInstance(): Services {
|
|
return new self( MediaWikiServices::getInstance() );
|
|
}
|
|
|
|
/**
|
|
* @param MediaWikiServices $services
|
|
* @return Services
|
|
*/
|
|
public static function wrap( MediaWikiServices $services ): Services {
|
|
return new self( $services );
|
|
}
|
|
|
|
/** @param MediaWikiServices $services */
|
|
public function __construct( MediaWikiServices $services ) {
|
|
$this->services = $services;
|
|
}
|
|
|
|
/** @return NotificationServiceClient */
|
|
public function getPushNotificationServiceClient(): NotificationServiceClient {
|
|
return $this->services->getService( 'EchoPushNotificationServiceClient' );
|
|
}
|
|
|
|
/** @return SubscriptionManager */
|
|
public function getPushSubscriptionManager(): SubscriptionManager {
|
|
return $this->services->getService( 'EchoPushSubscriptionManager' );
|
|
}
|
|
|
|
/** @return AttributeManager */
|
|
public function getAttributeManager(): AttributeManager {
|
|
return $this->services->getService( 'EchoAttributeManager' );
|
|
}
|
|
|
|
/** @return TitleLocalCache */
|
|
public function getTitleLocalCache(): TitleLocalCache {
|
|
return $this->services->getService( 'EchoTitleLocalCache' );
|
|
}
|
|
|
|
/** @return RevisionLocalCache */
|
|
public function getRevisionLocalCache(): RevisionLocalCache {
|
|
return $this->services->getService( 'EchoRevisionLocalCache' );
|
|
}
|
|
}
|