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

ConstraintsServices::getLoggingHelper()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 1
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