Completed
Pull Request — master (#18)
by Hannes
06:53
created

Generic16Formatter::format()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 6
rs 9.4285
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