calculateCheckDigit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace byrokrat\banking\Validator;
6
7
use byrokrat\banking\AccountNumber;
8
9
/**
10
 * Validate check digits for Handelsbanken accounts
11
 *
12
 * Checksum calculation is made on the serial number.
13
 */
14
class CheckDigitHandelsbankenValidator extends CheckDigitValidator
15
{
16 4
    protected function calculateCheckDigit(AccountNumber $number): string
17
    {
18 4
        return Modulo11::calculateCheckDigit($number->getSerialNumber());
19
    }
20
}
21