CountryProperty   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 28
ccs 15
cts 15
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A newFingerprint() 0 12 1
A newProperty() 0 7 1
A newPropertyId() 0 3 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