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

NordeaPersonal   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 30
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getClearingNumber() 0 4 2
A getPersonalId() 0 4 1
A getSerialNumber() 0 4 1
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