mediawiki-extensions-Thanks/includes/ThanksServices.php
Gergő Tisza 27b7bcd50d
Add service container
Change-Id: I25e91ff3294eaebe042bb8cbc90af72f37b4f1a9
2022-12-15 16:21:28 -08:00

37 lines
790 B
PHP

<?php
namespace MediaWiki\Extension\Thanks;
use MediaWiki\MediaWikiServices;
/**
* Service container class for the Thanks extension.
*/
class ThanksServices {
/** @var MediaWikiServices */
private MediaWikiServices $services;
/**
* Convenience method for returning an instance without having to use new, for chaining.
* @param MediaWikiServices $services
* @return self
*/
public static function wrap( MediaWikiServices $services ): self {
return new self( $services );
}
/**
* @param MediaWikiServices $services
*/
public function __construct( MediaWikiServices $services ) {
$this->services = $services;
}
/** @return ThanksQueryHelper */
public function getQueryHelper(): ThanksQueryHelper {
return $this->services->get( 'ThanksQueryHelper' );
}
}