Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
OAuthServices
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 4
20
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
 getConfig
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getWorkflow
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Extension\OAuth;
4
5use MediaWiki\Config\Config;
6use MediaWiki\Extension\OAuth\Control\Workflow;
7use MediaWiki\MediaWikiServices;
8
9class OAuthServices {
10
11    /** @var MediaWikiServices */
12    private $coreServices;
13
14    /**
15     * @param MediaWikiServices $coreServices
16     */
17    public function __construct( MediaWikiServices $coreServices ) {
18        $this->coreServices = $coreServices;
19    }
20
21    /**
22     * Static version of the constructor, for nicer syntax.
23     * @param MediaWikiServices $coreServices
24     * @return static
25     */
26    public static function wrap( MediaWikiServices $coreServices ) {
27        return new static( $coreServices );
28    }
29
30    public function getConfig(): Config {
31        return $this->coreServices->get( 'OAuthConfig' );
32    }
33
34    public function getWorkflow(): Workflow {
35        return $this->coreServices->get( 'OAuthWorkflow' );
36    }
37
38}