Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
50.00% covered (danger)
50.00%
2 / 4
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
Math
50.00% covered (danger)
50.00%
2 / 4
50.00% covered (danger)
50.00%
1 / 2
8.12
0.00% covered (danger)
0.00%
0 / 1
 __construct
n/a
0 / 0
n/a
0 / 0
1
 getMathConfig
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
2
 getCheckerFactory
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace MediaWiki\Extension\Math;
4
5use MediaWiki\Extension\Math\InputCheck\InputCheckFactory;
6use MediaWiki\MediaWikiServices;
7use Psr\Container\ContainerInterface;
8
9/**
10 * Top level factory for the Math extension.
11 *
12 * @license GPL-2.0-or-later
13 */
14final class Math {
15
16    /**
17     * @codeCoverageIgnore
18     */
19    private function __construct() {
20        // should not be instantiated
21    }
22
23    public static function getMathConfig( ContainerInterface $services = null ): MathConfig {
24        return ( $services ?: MediaWikiServices::getInstance() )
25            ->get( 'Math.Config' );
26    }
27
28    public static function getCheckerFactory( ContainerInterface $services = null ): InputCheckFactory {
29        return ( $services ?: MediaWikiServices::getInstance() )
30            ->get( 'Math.CheckerFactory' );
31    }
32}