KnowledgeBase::newItem()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Wikibase\DataFixtures\Items;
4
5
use Wikibase\DataModel\Entity\Item;
6
use Wikibase\DataModel\Entity\ItemId;
7
use Wikibase\DataModel\Term\Fingerprint;
8
9
/**
10
 * @since 1.1.0
11
 * @licence GNU GPL v2+
12
 * @author Jeroen De Dauw < [email protected] >
13
 */
14
class KnowledgeBase {
15
16 1
	public function newFingerprint() {
17 1
		$fingerprint = new Fingerprint();
18
19 1
		$fingerprint->setLabel( 'en', 'knowledge base' );
20 1
		$fingerprint->setLabel( 'de', 'Wissensdatenbank' );
21 1
		$fingerprint->setLabel( 'fr', 'base de connaissance' );
22
23 1
		$fingerprint->setAliasGroup( 'de', [ 'Knowledgebase', 'Wissensbasis', 'Wissensbank', 'Knowledge Base' ] );
24
25 1
		$fingerprint->setDescription( 'en', 'information repository with multiple applications' );
26
27 1
		return $fingerprint;
28
	}
29
30 1
	public function newItem() {
31 1
		$item = new Item( $this->newItemId() );
32
33 1
		$item->setFingerprint( $this->newFingerprint() );
34
35 1
		return $item;
36
	}
37
38 1
	public function newItemId() {
39 1
		return new ItemId( 'Q593744' );
40
	}
41
42
}
43