Skip to content

Commit 8dd5c35

Browse files
committed
added dockblock in code
1 parent 0acf42e commit 8dd5c35

File tree

3 files changed

+37
-4
lines changed

3 files changed

+37
-4
lines changed

src/Parser/PassportMrzParser.php

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class PassportMrzParser implements ParserInterface
2626
*
2727
* PTUNKKONI<<MARTINA<<<<<<<<<<<<<<<<<<<<<<<<<<
2828
* K0503499<8UNK9701241F06022201170650553<<<<10
29+
*
30+
* @param string $text
31+
* @return self
2932
*/
3033
protected function setText(string $text): self
3134
{
@@ -36,6 +39,8 @@ protected function setText(string $text): self
3639

3740
/**
3841
* Set Name String
42+
*
43+
* @return self
3944
*/
4045
protected function setNameString(): self
4146
{
@@ -46,6 +51,8 @@ protected function setNameString(): self
4651

4752
/**
4853
* Extract information
54+
*
55+
* @return self
4956
*/
5057
protected function extract(): self
5158
{
@@ -59,6 +66,8 @@ protected function extract(): self
5966

6067
/**
6168
* Second row first 9 character alpha+num+< Passport number
69+
*
70+
* @return null|string
6271
*/
6372
protected function getCardNo(): ?string
6473
{
@@ -70,6 +79,8 @@ protected function getCardNo(): ?string
7079

7180
/**
7281
* Get Passport Issuer
82+
*
83+
* @return null|string
7384
*/
7485
protected function getIssuer(): ?string
7586
{
@@ -81,6 +92,8 @@ protected function getIssuer(): ?string
8192
/**
8293
* Get Date of Expiry
8394
* Second row 22–27 character: (YYMMDD)
95+
*
96+
* @return null|string
8497
*/
8598
protected function getDateOfExpiry(): ?string
8699
{
@@ -92,6 +105,8 @@ protected function getDateOfExpiry(): ?string
92105
/**
93106
* Get Date of Birth
94107
* Second row 14–19 character: (YYMMDD)
108+
*
109+
* @return null|string
95110
*/
96111
protected function getDateOfBirth(): ?string
97112
{
@@ -102,8 +117,9 @@ protected function getDateOfBirth(): ?string
102117

103118
/**
104119
* Get First Name from Name String
120+
* For Ex, MARTINA<<<<<<<<<<<<<<<<<<<<<<<<<<
105121
*
106-
* MARTINA<<<<<<<<<<<<<<<<<<<<<<<<<<
122+
* @return null|string
107123
*/
108124
protected function getFirstName(): ?string
109125
{
@@ -113,15 +129,17 @@ protected function getFirstName(): ?string
113129
/**
114130
* Get Last Name from Name String
115131
*
132+
* @return null|string
116133
*/
117134
protected function getLastName(): ?string
118135
{
119136
return $this->nameString[0] ?? null;
120137
}
121138

122139
/**
123-
* Get Gender
124-
* Position 21, M/F/<
140+
* Get Gender from Position 21, M/F/<
141+
*
142+
* @return null|string
125143
*
126144
*/
127145
protected function getGender(): ?string
@@ -131,8 +149,9 @@ protected function getGender(): ?string
131149

132150
/**
133151
* Get Personal Number
134-
*
135152
* 29–42 alpha+num+< (may be used by the issuing country as it desires)
153+
*
154+
* @return null|string
136155
*/
137156
protected function getPersonalNumber(): ?string
138157
{
@@ -141,6 +160,8 @@ protected function getPersonalNumber(): ?string
141160

142161
/**
143162
* Get Nationality
163+
*
164+
* @return null|string
144165
*/
145166
protected function getNationality(): ?string
146167
{

src/Traits/CountryMapper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,12 @@ trait CountryMapper
305305
"GBS" => "United Kingdom of Great Britain and Northern Ireland Subject", // British Subject
306306
];
307307

308+
/**
309+
* Map country name based on code
310+
*
311+
* @param string|null $code
312+
* @return string|null
313+
*/
308314
public function mapCountry(string $code = null): ?string
309315
{
310316
$allCountry = array_merge(

src/Traits/GenderMapper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
trait GenderMapper
66
{
7+
/**
8+
* Map Gender based on Code (M/F)
9+
*
10+
* @param string|null $code
11+
* @return string|null
12+
*/
713
public function mapGender(string $code = null): ?string
814
{
915
return match ($code) {

0 commit comments

Comments
 (0)