SepaCntryValidationAT   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 7
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
1
<?php
2
namespace SKien\Sepa\CntryValidation;
3
4
/**
5
 * Validation class for austrian IBAN and CI
6
 *
7
 * #### Valid testvalues
8
 * <table><tbody>
9
 * <tr><td>   IBAN   </td><td> AT61 1904 3002 3457 3201 </td></tr>
10
 * <tr><td>   BIC    </td><td> RVVGAT2B468 </td></tr>
11
 * <tr><td>   CI     </td><td> AT61 ZZZ 01234567890 </td></tr>
12
 * </tbody></table>
13
 *
14
 * #### IBAN format
15
 * #### ` CCpp bbbb bkkk kkkk kkkk k `
16
 * <table><tbody>
17
 * <tr><td>   CC     </td><td> ISO Country Code </td></tr>
18
 * <tr><td>   pp     </td><td> 2 digits IBAN checksum </td></tr>
19
 * <tr><td>   b      </td><td> banking code 5 digits </td></tr>
20
 * <tr><td>   k      </td><td> account number 11 digits </td></tr>
21
 * </tbody></table>
22
 *
23
 * Length: 20
24
 *
25
 * #### CI format
26
 * #### ` CCpp ZZZ 0nnnnnnnnnn `
27
 * <table><tbody>
28
 * <tr><td>   C      </td><td> ISO Country Code </td></tr>
29
 * <tr><td>   p      </td><td> 2 digits IBAN checksum </td></tr>
30
 * <tr><td>   Z      </td><td> 3 digits alphanum creditor business code </td></tr>
31
 * <tr><td>   0      </td><td> 1 digit fixed value 0 </td></tr>
32
 * <tr><td>   n      </td><td> 10 digits numeric national identification code </td></tr>
33
 * </tbody></table>
34
 *
35
 * Length: 18
36
 *
37
 * <b>All validation can be done with specification of length and regex to match format! </b>
38
 *
39
 * @package Sepa
40
 * @author Stefanius <[email protected]>
41
 * @copyright MIT License - see the LICENSE file for details
42
 */
43
class SepaCntryValidationAT extends SepaCntryValidationBase
44
{
45
    /**
46
     * Create instance of austrian validation.
47
     * @param string $strCntry  2 sign country code
48
     */
49
    public function __construct(string $strCntry)
50
    {
51
        $this->strCntry = 'AT';
52
        $this->iLenIBAN = 20;
53
        $this->strRegExIBAN = '/^([A-Z]){2}([0-9]){18}?$/';
54
        $this->iLenCI = 18;
55
        $this->strRegExCI = '/^([A-Z]){2}([0-9]){2}([0-9A-Z]){3}([0-9]){11}?$/';
56
57
        parent::__construct(strtoupper($strCntry));
58
    }
59
}