PostalCodeProperty   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A newFingerprint() 0 9 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 PostalCodeProperty {
14
15 1
	public function newFingerprint() {
16 1
		$fingerprint = new Fingerprint();
17
18 1
		$fingerprint->setLabel( 'en', 'postal code' );
19 1
		$fingerprint->setAliasGroup( 'en', [ 'zip code', 'post code' ] );
20 1
		$fingerprint->setDescription( 'en', 'identifier assigned by postal authorities for the subject area' );
21
22 1
		return $fingerprint;
23
	}
24
25 1
	public function newProperty() {
26 1
		return new Property(
27 1
			$this->newPropertyId(),
28 1
			$this->newFingerprint(),
29
			'string'
30 1
		);
31
	}
32
33 2
	public function newPropertyId() {
34 2
		return new PropertyId( 'P281' );
35
	}
36
37
}
38