InstanceOfProperty   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
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 27
ccs 14
cts 14
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A newFingerprint() 0 11 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 InstanceOfProperty {
14
15 1
	public function newFingerprint() {
16 1
		$fingerprint = new Fingerprint();
17
18 1
		$fingerprint->setLabel( 'en', 'instance of' );
19 1
		$fingerprint->setLabel( 'de', 'ist ein(e)' );
20
21 1
		$fingerprint->setDescription( 'en', 'this item is a concrete object (instance) of this class, category or object group' );
22 1
		$fingerprint->setDescription( 'de', 'Ausprägung oder Exemplar einer Sache' );
23
24 1
		return $fingerprint;
25
	}
26
27 1
	public function newProperty() {
28 1
		return new Property(
29 1
			$this->newPropertyId(),
30 1
			$this->newFingerprint(),
31
			'wikibase-item'
32 1
		);
33
	}
34
35 2
	public function newPropertyId() {
36 2
		return new PropertyId( 'P31' );
37
	}
38
39
}
40