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

Generic16Formatter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 6 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