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

StandardFormatter::format()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 1
nop 1
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
ccs 7
cts 7
cp 1
crap 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