Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 11
CRAP
0.00% covered (danger)
0.00%
0 / 1
CommunityConfigurationServices
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 11
132
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 wrap
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getEditorCapabilityFactory
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getHookRunner
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getConfigurationProviderFactory
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getMediaWikiConfigReader
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSchemaConverterFactory
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSchemaMigrator
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getStoreFactory
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getValidatorFactory
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getWikiPageStoreWriter
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Extension\CommunityConfiguration;
4
5use MediaWiki\Extension\CommunityConfiguration\Access\MediaWikiConfigReader;
6use MediaWiki\Extension\CommunityConfiguration\EditorCapabilities\EditorCapabilityFactory;
7use MediaWiki\Extension\CommunityConfiguration\Hooks\HookRunner;
8use MediaWiki\Extension\CommunityConfiguration\Provider\ConfigurationProviderFactory;
9use MediaWiki\Extension\CommunityConfiguration\Schema\SchemaConverterFactory;
10use MediaWiki\Extension\CommunityConfiguration\Schema\SchemaMigrator;
11use MediaWiki\Extension\CommunityConfiguration\Store\StoreFactory;
12use MediaWiki\Extension\CommunityConfiguration\Store\WikiPage\Writer;
13use MediaWiki\Extension\CommunityConfiguration\Validation\ValidatorFactory;
14use MediaWiki\MediaWikiServices;
15
16class CommunityConfigurationServices {
17
18    private MediaWikiServices $coreServices;
19
20    /**
21     * @param MediaWikiServices $coreServices
22     */
23    public function __construct( MediaWikiServices $coreServices ) {
24        $this->coreServices = $coreServices;
25    }
26
27    /**
28     * Static version of the constructor, for nicer syntax.
29     * @param MediaWikiServices $coreServices
30     * @return static
31     */
32    public static function wrap( MediaWikiServices $coreServices ) {
33        return new static( $coreServices );
34    }
35
36    public function getEditorCapabilityFactory(): EditorCapabilityFactory {
37        return $this->coreServices->getService( 'CommunityConfiguration.EditorCapabilityFactory' );
38    }
39
40    public function getHookRunner(): HookRunner {
41        return $this->coreServices->getService( 'CommunityConfiguration.HookRunner' );
42    }
43
44    public function getConfigurationProviderFactory(): ConfigurationProviderFactory {
45        return $this->coreServices->getService( 'CommunityConfiguration.ProviderFactory' );
46    }
47
48    public function getMediaWikiConfigReader(): MediaWikiConfigReader {
49        return $this->coreServices->getService( 'CommunityConfiguration.MediaWikiConfigReader' );
50    }
51
52    public function getSchemaConverterFactory(): SchemaConverterFactory {
53        return $this->coreServices->getService( 'CommunityConfiguration.SchemaConverterFactory' );
54    }
55
56    public function getSchemaMigrator(): SchemaMigrator {
57        return $this->coreServices->getService( 'CommunityConfiguration.SchemaMigrator' );
58    }
59
60    public function getStoreFactory(): StoreFactory {
61        return $this->coreServices->getService( 'CommunityConfiguration.StoreFactory' );
62    }
63
64    public function getValidatorFactory(): ValidatorFactory {
65        return $this->coreServices->getService( 'CommunityConfiguration.ValidatorFactory' );
66    }
67
68    public function getWikiPageStoreWriter(): Writer {
69        return $this->coreServices->getService( 'CommunityConfiguration.WikiPageStore.Writer' );
70    }
71}