1 | <?php |
||
10 | class FakeId extends PersonalId |
||
11 | { |
||
12 | /** |
||
13 | * Regular expression describing id structure |
||
14 | */ |
||
15 | protected const PATTERN = '/^((?:\d\d)?)(\d{6})([-+]?)(xx[0-9xfmo])(x)$/i'; |
||
16 | |||
17 | /** |
||
18 | * Create fake personal identity number |
||
19 | * |
||
20 | * Fake ids replace serial number post delimiter with xxxx. If sex should be |
||
21 | * encoded xxFx, xxMx or xxOx can be used, denoting Female, Male or Other. |
||
22 | * |
||
23 | * @param string $raw The raw id to parse |
||
24 | * @param \DateTimeInterface $atDate Optional date when parsing takes place, defaults to today |
||
25 | 34 | * @throws UnableToCreateIdException On failure to create id |
|
26 | */ |
||
27 | 34 | public function __construct(string $raw, \DateTimeInterface $atDate = null) |
|
36 | |||
37 | public function getSex(): string |
||
47 | |||
48 | 12 | public function getBirthCounty(): string |
|
52 | |||
53 | protected function validateCheckDigit(): void |
||
57 | } |
||
58 |