@@ 44-49 (lines=6) @@ | ||
41 | $strlen = strlen($id_number); |
|
42 | ||
43 | switch ($strlen) { |
|
44 | case 9: |
|
45 | if (!ctype_digit($id_number)) { |
|
46 | throw new InvalidIdentityCardNumberException('Provided string is not all-numeric', 102); |
|
47 | } |
|
48 | $this->data_components['format'] = static::ID_FORMAT_PRE_2016; |
|
49 | return (int) $id_number; |
|
50 | ||
51 | case 10: |
|
52 | if ($id_number[9] !== 'V') { |
|
@@ 62-67 (lines=6) @@ | ||
59 | $this->data_components['format'] = static::ID_FORMAT_PRE_2016; |
|
60 | return (int) $id_number; |
|
61 | ||
62 | case 12: |
|
63 | if (!ctype_digit($id_number)) { |
|
64 | throw new InvalidIdentityCardNumberException('Provided number is not all-numeric', 102); |
|
65 | } |
|
66 | $this->data_components['format'] = static::ID_FORMAT_2016; |
|
67 | return (int) $id_number; |
|
68 | ||
69 | default: |
|
70 | throw new InvalidIdentityCardNumberException('Provided number is not of a satisfiable length.', 100); |