Skip to content

Commit

Permalink
Merge pull request #8 from seisigmasrl/feature/rnc-type
Browse files Browse the repository at this point in the history
Adding helper method on the Types enum.
  • Loading branch information
ricardov03 authored Feb 7, 2023
2 parents f5f5fa4 + 10348fe commit b9c8d75
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/helpers/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,13 @@ public function toString(): string
self::PASSPORT => 'Pasaporte',
};
}

public function fromString(string $string): self
{
return match ($string) {
'RNC' => self::RNC,
'Cédula' => self::CEDULA,
'Pasaporte' => self::PASSPORT,
};
}
}

0 comments on commit b9c8d75

Please sign in to comment.