Completed
Push — master ( aa47cc...29c144 )
by
unknown
05:31
created

ConstraintsServices::getService()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 4
nc 2
nop 2
1
<?php
2
3
namespace WikibaseQuality\ConstraintReport;
4
5
use MediaWiki\MediaWikiServices;
6
use WikibaseQuality\ConstraintReport\ConstraintCheck\Helper\LoggingHelper;
7
8
/**
9
 * @license GPL-2.0-or-later
10
 */
11
class ConstraintsServices {
12
13
	private static function getService( MediaWikiServices $services = null, $name ) {
14
		if ( $services === null ) {
15
			$services = MediaWikiServices::getInstance();
16
		}
17
		return $services->getService( $name );
18
	}
19
20
	/**
21
	 * @param MediaWikiServices|null $services
22
	 * @return LoggingHelper
23
	 */
24
	public static function getLoggingHelper( MediaWikiServices $services = null ) {
25
		return self::getService( $services, 'WBQC_LoggingHelper' );
26
	}
27
28
}
29