Human   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 15
c 2
b 0
f 0
dl 0
loc 53
ccs 0
cts 17
cp 0
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A mothers() 0 2 1
A children() 0 2 1
A spouses() 0 2 1
A fathers() 0 2 1
A getDatesOfDeath() 0 2 1
A getDatesOfBirth() 0 2 1
1
<?php
2
3
namespace Samwilson\SimpleWikidata\Items;
4
5
use Samwilson\SimpleWikidata\Item;
6
7
/**
8
 * @link https://www.wikidata.org/wiki/Q5
9
 */
10
class Human extends Item {
11
12
	const PROP_DATE_OF_BIRTH = 'P569';
13
	const PROP_PLACE_OF_BIRTH = 'P19';
14
15
	const PROP_DATE_OF_DEATH = 'P570';
16
	const PROP_PLACE_OF_DEATH = 'P20';
17
18
	const PROP_FATHER = 'P22';
19
	const PROP_MOTHER = 'P25';
20
	const PROP_SPOUSE = 'P26';
21
	const PROP_CHILD = 'P40';
22
23
	/**
24
	 * @return bool|\Samwilson\SimpleWikidata\Properties\Time[]
25
	 */
26
	public function getDatesOfBirth() {
27
		return $this->getPropertyOfTypeTime( self::PROP_DATE_OF_BIRTH );
28
	}
29
30
	/**
31
	 * @return bool|\Samwilson\SimpleWikidata\Properties\Time[]
32
	 */
33
	public function getDatesOfDeath() {
34
		return $this->getPropertyOfTypeTime( self::PROP_DATE_OF_DEATH );
35
	}
36
37
	/**
38
	 * @return \Samwilson\SimpleWikidata\Properties\Item[]
39
	 */
40
	public function fathers() {
41
		return $this->getPropertyOfTypeItem( self::PROP_FATHER );
42
	}
43
44
	/**
45
	 * @return \Samwilson\SimpleWikidata\Properties\Item[]
46
	 */
47
	public function mothers() {
48
		return $this->getPropertyOfTypeItem( self::PROP_FATHER );
49
	}
50
51
	/**
52
	 * @return \Samwilson\SimpleWikidata\Properties\Item[]
53
	 */
54
	public function spouses() {
55
		return $this->getPropertyOfTypeItem( self::PROP_SPOUSE );
56
	}
57
58
	/**
59
	 * @return \Samwilson\SimpleWikidata\Properties\Item[]
60
	 */
61
	public function children() {
62
		return $this->getPropertyOfTypeItem( self::PROP_CHILD );
63
	}
64
}
65