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

ConstraintsServices   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getService() 0 6 2
A getLoggingHelper() 0 3 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