Completed
Push — master ( a004d3...9bce71 )
by Hannes
03:41 queued 02:35
created

CoordinationId::getBirthCounty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace byrokrat\id;
4
5
/**
6
 * Coordination id number
7
 *
8
 * A coordination number is like a personal number except that 60 is added
9
 * to the date of birth.
10
 */
11
class CoordinationId extends PersonalId
12
{
13
    /**
14
     * Coordination id number
15
     *
16
     * {@inheritdoc}
17
     *
18
     * @param string $number
19
     */
20 46
    public function __construct($number)
21
    {
22 46
        list(, $century, $datestr, $delim, $serialPost, $check) = $this->parseNumber(self::PATTERN, $number);
23 28
        $dob = intval($datestr) - 60;
24 28
        parent::__construct($century.$dob.$delim.$serialPost.$check);
25 10
    }
26
27 28
    public function getSerialPreDelimiter()
28
    {
29 28
        return (string) intval(parent::getSerialPreDelimiter()) + 60;
30
    }
31
32 1
    public function getBirthCounty()
33
    {
34 1
        return IdInterface::COUNTY_UNDEFINED;
35
    }
36
}
37