Generic16Formatter::format()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
ccs 4
cts 4
cp 1
crap 1
1
<?php
2
3
namespace byrokrat\banking\Formatter;
4
5
use byrokrat\banking\AccountNumber;
6
7
/**
8
 * Formatter for the BGC 16 digit format
9
 */
10
class Generic16Formatter implements FormatterInterface
11
{
12 88
    public function format(AccountNumber $number): string
13
    {
14 88
        return $number->getClearingNumber()
15 88
            . str_pad($number->getSerialNumber(), 11, '0', STR_PAD_LEFT)
16 88
            . $number->getCheckDigit();
17
    }
18
}
19