City::newItem()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 2
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
 * @licence GNU GPL v2+
11
 * @author Jeroen De Dauw < [email protected] >
12
 */
13
class City {
14
15
	public function newFingerprint() {
16
		$fingerprint = new Fingerprint();
17
18
		$fingerprint->setLabel( 'en', 'city' );
19
		$fingerprint->setLabel( 'de', 'Stadt' );
20
21
		$fingerprint->setDescription( 'en', 'permanent settlement larger than a town, generally with a population of at least tens of thousands' );
22
		$fingerprint->setDescription( 'de', 'größere, zentralisierte und abgegrenzte Siedlung' );
23
24
		return $fingerprint;
25
	}
26
27
	public function newItem() {
28
		$item = new Item( $this->newItemId() );
29
30
		$item->setFingerprint( $this->newFingerprint() );
31
32
		return $item;
33
	}
34
35 1
	public function newItemId() {
36 1
		return new ItemId( 'Q515' );
37
	}
38
39
}
40