SepaCntryValidationNL::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 11
rs 10
cc 1
nc 1
nop 1
1
<?php
2
namespace SKien\Sepa\CntryValidation;
3
4
/**
5
 * Validation class for netherlands IBAN and CI
6
 *
7
 * #### Valid testvalues
8
 * <table><tbody>
9
 * <tr><td>   IBAN   </td><td> NL45 SNSB 0787 7543 90 </td></tr>
10
 * <tr><td>   BIC    </td><td> SNSBNL2AXXX </td></tr>
11
 * <tr><td>   CI     </td><td> NL50 ZZZ 123456789012 </td></tr>
12
 * </tbody></table>
13
 *
14
 * #### IBAN format
15
 * #### ` CCpp bbbb kkkk kkkk kk `
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> bank identifier 4 alphanum digits </td></tr>
20
 * <tr><td>   k      </td><td> account number 10 digits </td></tr>
21
 * </tbody></table>
22
 *
23
 * Length: 18
24
 *
25
 * #### CI format
26
 * #### ` CCpp ZZZ nnnnnnnn kkkk
27
 * <table><tbody>
28
 * <tr><td>   C      </td><td> ISO Country Code </td></tr>
29
 * <tr><td>   p      </td><td> 2 digits CI checksum </td></tr>
30
 * <tr><td>   Z      </td><td> 3 digits creditor business code </td></tr>
31
 * <tr><td>   n      </td><td> 8 digits trade register number (KvK number) of the creditor </td></tr>
32
 * <tr><td>   k      </td><td> 4 digits numerical code as issued or agreed by the creditor bank </td></tr>
33
 * </tbody></table>
34
 *
35
 * Length: 19
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 SepaCntryValidationNL extends SepaCntryValidationBase
44
{
45
    /**
46
     * Create instance of german validation.
47
     * @param string $strCntry  2 sign country code
48
     */
49
    public function __construct(string $strCntry)
50
    {
51
        $this->strCntry = 'NL';
52
        $this->iLenIBAN = 18;
53
        $this->bAlphaNumIBAN = true;
54
        $this->strRegExIBAN = '/^([A-Z]){2}([0-9]){2}([0-9A-Z]){4}([0-9]){10}?$/';
55
        $this->iLenCI = 19;
56
        $this->bAlphaNumCI = true;
57
        $this->strRegExCI = '/^([A-Z]){2}([0-9]){2}([0-9A-Z]){3}([0-9]){12}?$/';
58
59
        parent::__construct(strtoupper($strCntry));
60
    }
61
}