CountryProperty::newFingerprint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
ccs 8
cts 8
cp 1
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Wikibase\DataFixtures\Properties;
4
5
use Wikibase\DataModel\Entity\Property;
6
use Wikibase\DataModel\Entity\PropertyId;
7
use Wikibase\DataModel\Term\Fingerprint;
8
9
/**
10
 * @licence GNU GPL v2+
11
 * @author Jeroen De Dauw < [email protected] >
12
 */
13
class CountryProperty {
14
15 1
	public function newFingerprint() {
16 1
		$fingerprint = new Fingerprint();
17
18 1
		$fingerprint->setLabel( 'en', 'country' );
19 1
		$fingerprint->setLabel( 'de', 'Staat' );
20 1
		$fingerprint->setLabel( 'nl', 'Land' );
21
22 1
		$fingerprint->setDescription( 'en', 'sovereign state of this item' );
23 1
		$fingerprint->setDescription( 'de', 'souveräner Staat, in dem sich das Objekt befindet' );
24
25 1
		return $fingerprint;
26
	}
27
28 1
	public function newProperty() {
29 1
		return new Property(
30 1
			$this->newPropertyId(),
31 1
			$this->newFingerprint(),
32
			'wikibase-item'
33 1
		);
34
	}
35
36 2
	public function newPropertyId() {
37 2
		return new PropertyId( 'P17' );
38
	}
39
40
}
41