Passed
Push — master ( 750c68...36913a )
by
unknown
02:38
created

TermStoreSchemaUpdater   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 24
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getSqlFileAbsolutePath() 0 3 1
A __construct() 0 3 1
A onSchemaUpdate() 0 3 1
A updateSchema() 0 6 1
1
<?php
2
3
namespace Wikibase\TermStore\MediaWiki;
4
5
use DatabaseUpdater;
6
7
class TermStoreSchemaUpdater {
8
9
	private $updater;
10
11
	public static function getSqlFileAbsolutePath() {
12
		return __DIR__ . '/PackagePrivate/AddNormalizedTermsTablesDDL.sql';
13
	}
14
15
	private function __construct( DatabaseUpdater $updater ) {
16
		$this->updater = $updater;
17
	}
18
19
	public static function onSchemaUpdate( DatabaseUpdater $updater ) {
20
		( new self( $updater ) )->updateSchema();
21
	}
22
23
	private function updateSchema() {
24
		$this->updater->addExtensionTable(
25
			'wbt_item_terms',
26
			self::getSqlFileAbsolutePath()
27
		);
28
	}
29
30
}
31