PostalCodeProperty::newFingerprint()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.6666
cc 1
eloc 6
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 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