Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 9
CRAP
0.00% covered (danger)
0.00%
0 / 11
Services
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 9
90
0.00% covered (danger)
0.00%
0 / 11
 __construct
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 getInstance
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 get
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 has
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getGroupSynchronizationCache
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getParsingPlaceholderFactory
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getTranslatablePageParser
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getTranslationStatsDataProvider
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 getTranslatorActivity
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
<?php
/**
 * @file
 * @author Niklas Laxström
 * @license GPL-2.0-or-later
 */
namespace MediaWiki\Extensions\Translate;
use MediaWiki\Extensions\Translate\PageTranslation\TranslatablePageParser;
use MediaWiki\Extensions\Translate\Statistics\TranslationStatsDataProvider;
use MediaWiki\Extensions\Translate\Statistics\TranslatorActivity;
use MediaWiki\Extensions\Translate\Synchronization\GroupSynchronizationCache;
use MediaWiki\Extensions\Translate\Utilities\ParsingPlaceholderFactory;
use MediaWiki\MediaWikiServices;
use Psr\Container\ContainerInterface;
/**
 * Minimal service container.
 *
 * Main purpose is to give type-hinted getters for services defined in this extensions.
 *
 * @since 2020.04
 */
class Services implements ContainerInterface {
    /** @var self */
    private static $instance;
    /** @var ContainerInterface */
    private $container;
    private function __construct( ContainerInterface $container ) {
        $this->container = $container;
    }
    public static function getInstance(): Services {
        self::$instance = self::$instance ?? new self( MediaWikiServices::getInstance() );
        return self::$instance;
    }
    /** @inheritDoc */
    public function get( $id ) {
        return $this->container->get( $id );
    }
    /** @inheritDoc */
    public function has( $id ) {
        return $this->container->has( $id );
    }
    public function getGroupSynchronizationCache(): GroupSynchronizationCache {
        return $this->get( 'Translate:GroupSynchronizationCache' );
    }
    /** @since 2020.07 */
    public function getParsingPlaceholderFactory(): ParsingPlaceholderFactory {
        return $this->get( 'Translate:ParsingPlaceholderFactory' );
    }
    public function getTranslatablePageParser(): TranslatablePageParser {
        return $this->get( 'Translate:TranslatablePageParser' );
    }
    /** @since 2020.09 */
    public function getTranslationStatsDataProvider(): TranslationStatsDataProvider {
        return $this->get( 'Translate:TranslationStatsDataProvider' );
    }
    public function getTranslatorActivity(): TranslatorActivity {
        return $this->get( 'Translate:TranslatorActivity' );
    }
}