MissingAncestor   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 76
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A isMotherMissing() 0 3 1
A isFatherMissing() 0 3 1
A individual() 0 3 1
A sosa() 0 3 1
A __construct() 0 6 1
1
<?php
2
3
/**
4
 * webtrees-lib: MyArtJaub library for webtrees
5
 *
6
 * @package MyArtJaub\Webtrees
7
 * @subpackage Sosa
8
 * @author Jonathan Jaubart <[email protected]>
9
 * @copyright Copyright (c) 2020-2022, Jonathan Jaubart
10
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3
11
 */
12
13
declare(strict_types=1);
14
15
namespace MyArtJaub\Webtrees\Module\Sosa\Data;
16
17
use Fisharebest\Webtrees\Individual;
18
19
/**
20
 * Data class for Missing Ancestors datatable row
21
 */
22
class MissingAncestor
23
{
24
    /**
25
     * @var Individual $individual
26
     */
27
    private $individual;
28
29
    /**
30
     * @var int $sosa
31
     */
32
    private $sosa;
33
34
    /**
35
     * @var bool $missing_father
36
     */
37
    private $missing_father;
38
39
    /**
40
     * @var bool $missing_mother
41
     */
42
    private $missing_mother;
43
44
    /**
45
     * Constructor for MissingAncestor data class
46
     *
47
     * @param Individual $ancestor
48
     * @param int $sosa
49
     * @param bool $missing_father
50
     * @param bool $missing_mother
51
     */
52
    public function __construct(Individual $ancestor, int $sosa, bool $missing_father, bool $missing_mother)
53
    {
54
        $this->individual = $ancestor;
55
        $this->sosa = $sosa;
56
        $this->missing_father = $missing_father;
57
        $this->missing_mother = $missing_mother;
58
    }
59
60
    /**
61
     * Reference individual of the row
62
     *
63
     * @return Individual
64
     */
65
    public function individual(): Individual
66
    {
67
        return $this->individual;
68
    }
69
70
    /**
71
     * Minimum sosa of the reference individual
72
     *
73
     * @return int
74
     */
75
    public function sosa(): int
76
    {
77
        return $this->sosa;
78
    }
79
80
    /**
81
     * Indicate whether the reference individual does not have a father
82
     *
83
     * @return bool
84
     */
85
    public function isFatherMissing(): bool
86
    {
87
        return $this->missing_father;
88
    }
89
90
    /**
91
     * Indicate whether the reference individual does not have a mother
92
     *
93
     * @return bool
94
     */
95
    public function isMotherMissing(): bool
96
    {
97
        return $this->missing_mother;
98
    }
99
}
100