Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 9
CRAP
0.00% covered (danger)
0.00%
0 / 1
CommunityConfigurationServices
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 9
90
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
 getConfigurationProviderFactory
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
 getStoreFactory
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getWikiPageConfigReader
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getWikiPageStoreLoader
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\WikiPageConfigReader;
6use MediaWiki\Extension\CommunityConfiguration\EditorCapabilities\EditorCapabilityFactory;
7use MediaWiki\Extension\CommunityConfiguration\Provider\ConfigurationProviderFactory;
8use MediaWiki\Extension\CommunityConfiguration\Store\StoreFactory;
9use MediaWiki\Extension\CommunityConfiguration\Store\WikiPage\Loader;
10use MediaWiki\Extension\CommunityConfiguration\Store\WikiPage\Writer;
11use MediaWiki\Extension\CommunityConfiguration\Validation\ValidatorFactory;
12use MediaWiki\MediaWikiServices;
13
14class CommunityConfigurationServices {
15
16    private MediaWikiServices $coreServices;
17
18    /**
19     * @param MediaWikiServices $coreServices
20     */
21    public function __construct( MediaWikiServices $coreServices ) {
22        $this->coreServices = $coreServices;
23    }
24
25    /**
26     * Static version of the constructor, for nicer syntax.
27     * @param MediaWikiServices $coreServices
28     * @return static
29     */
30    public static function wrap( MediaWikiServices $coreServices ) {
31        return new static( $coreServices );
32    }
33
34    public function getEditorCapabilityFactory(): EditorCapabilityFactory {
35        return $this->coreServices->getService( 'CommunityConfiguration.EditorCapabilityFactory' );
36    }
37
38    public function getConfigurationProviderFactory(): ConfigurationProviderFactory {
39        return $this->coreServices->getService( 'CommunityConfiguration.ProviderFactory' );
40    }
41
42    public function getValidatorFactory(): ValidatorFactory {
43        return $this->coreServices->getService( 'CommunityConfiguration.ValidatorFactory' );
44    }
45
46    public function getStoreFactory(): StoreFactory {
47        return $this->coreServices->getService( 'CommunityConfiguration.StoreFactory' );
48    }
49
50    public function getWikiPageConfigReader(): WikiPageConfigReader {
51        return $this->coreServices->getService( 'CommunityConfiguration.WikiPageConfigReader' );
52    }
53
54    public function getWikiPageStoreLoader(): Loader {
55        return $this->coreServices->getService( 'CommunityConfiguration.WikiPageStore.Loader' );
56    }
57
58    public function getWikiPageStoreWriter(): Writer {
59        return $this->coreServices->getService( 'CommunityConfiguration.WikiPageStore.Writer' );
60    }
61}