BankgiroFormatter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 9 1
1
<?php
2
3
namespace byrokrat\banking\Formatter;
4
5
use byrokrat\banking\AccountNumber;
6
7
class BankgiroFormatter implements FormatterInterface
8
{
9 2
    public function format(AccountNumber $number): string
10
    {
11 2
        return sprintf(
12 2
            '%s-%s%s',
13 2
            substr($number->getSerialNumber(), 0, -3),
14 2
            substr($number->getSerialNumber(), -3),
15 2
            $number->getCheckDigit()
16
        );
17
    }
18
}
19