Completed
Push — master ( d62272...836ed7 )
by Hannes
05:38 queued 03:31
created

NordeaPersonal::getClearingNumber()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace byrokrat\banking;
4
5
use byrokrat\id\PersonalId;
6
7
/**
8
 * Account number where the serial number is a swedish personal id
9
 */
10
class NordeaPersonal extends BaseAccount
11
{
12
    /**
13
     * Default to clearing 3300 if no clearing is specified
14
     */
15 31
    public function getClearingNumber()
16
    {
17 31
        return parent::getClearingNumber() ?: '3300';
18
    }
19
20
    /**
21
     * Get personal id associated with this account number
22
     *
23
     * @return PersonalId
24
     */
25 1
    public function getPersonalId()
26
    {
27 1
        return new PersonalId($this->getSerialNumber() . $this->getCheckDigit());
28
    }
29
30
    /**
31
     * Strip optional delimiter from serial number
32
     *
33
     * @return string
34
     */
35 31
    public function getSerialNumber()
36
    {
37 31
        return str_replace('-', '', parent::getSerialNumber());
38
    }
39
}
40