Completed
Push — master ( 5d18c7...cabcf3 )
by Hannes
16s queued 13s
created

StandardFormatter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 10
c 0
b 0
f 0
ccs 7
cts 7
cp 1
wmc 2
lcom 0
cbo 1

1 Method

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