Completed
Push — master ( a7ac36...44c26f )
by Jeroen De
02:07 queued 10s
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 __construct() 0 3 1
A onSchemaUpdate() 0 3 1
A updateSchema() 0 6 1
A getDdlSqlFilePath() 0 3 1
1
<?php
2
3
namespace Wikibase\TermStore\MediaWiki;
4
5
use DatabaseUpdater;
6
7
class TermStoreSchemaUpdater {
8
9
	private $updater;
10
11
	private function __construct( DatabaseUpdater $updater ) {
12
		$this->updater = $updater;
13
	}
14
15
	public static function onSchemaUpdate( DatabaseUpdater $updater ) {
16
		( new self( $updater ) )->updateSchema();
17
	}
18
19
	public static function getDdlSqlFilePath() {
20
		return __DIR__ . '/PackagePrivate/AddNormalizedTermsTablesDDL.sql';
21
	}
22
23
	private function updateSchema() {
24
		$this->updater->addExtensionTable(
25
			'wbt_item_terms',
26
			self::getDdlSqlFilePath()
27
		);
28
	}
29
30
}
31