CheckDigitHandelsbankenValidator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
wmc 1
lcom 0
cbo 3

1 Method

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