Releases: rakibdevs/mrz-parser
Releases · rakibdevs/mrz-parser
Release list
v2.0.0
What's Changed
- v2.0.0 — PHP 8.2, check-digit validation, typed API, and new formats by @rakibdevs in #17
Breaking changes
- Minimum PHP version is now 8.2 (was 8.0).
parse()now returns additional keys (issuer_code,nationality_code,sex,optional_data,valid,validation,raw). Existing keys are unchanged.Enums\DocumentTypeis now a real backed enum instead of an abstract class with constants.
Added
- ICAO 9303 check-digit validation. Each result exposes an overall
validflag plus a per-fieldvalidationmap (document number, date of birth, date of expiry, personal number, and composite). - Richer output: raw ISO alpha-3 codes (
issuer_code,nationality_code), rawsexcharacter,optional_data, and the normalizedrawMRZ string. - Typed
MrzResultobject viaMrzParser::read()— typed properties,dateOfBirthAsDate()/dateOfExpiryAsDate(),isExpired(),fullName(), andtoArray(). - Non-throwing entry points
MrzParser::tryParse()andMrzParser::tryRead()returningnullon invalid input. - Strict check-digit mode (
parse($text, strict: true)) throwingInvalidChecksumExceptionwhen a check digit fails. - Name transliteration (
Support\Transliterator):fromLatin()andmatches()for converting/comparing accented names against the MRZ. - French national ID (2×36 legacy format) support.
- Laravel integration: auto-discovered service provider and a
ValidMrzvalidation rule. - A full Pest test suite (parsers, validator, check digits, mappers, DTO, transliteration, Laravel rule) with ~99% coverage.
Fixed
- CRLF / whitespace input is now normalized, so Windows- and OCR-sourced MRZ strings parse correctly instead of failing validation.
- Strict date validation rejects impossible calendar dates (e.g. Feb 30) instead of silently rolling them over.
- A date of birth that would resolve to the future is shifted back a century.
- Removed a PHP 8.4 implicit-nullable deprecation and guarded against
substr(null, ...)on missing rows. - Consistent trailing-filler trimming for given names across all document types.
Changed
- Modernized the codebase:
declare(strict_types=1), typed properties,match-based adapter selection, and a cached country lookup table. - CI now tests PHP 8.2, 8.3, 8.4 and 8.5; upgraded to Pest 3.
New Contributors
- @rakibdevs made their first contribution in #17
Full Changelog: v1.2.0...v2.0.0
v1.2.0
Full Changelog: v1.1.0...v1.2.0
- Fixed Card No and First Name "<" Issue in Visa b292c6a
- Added Semantic Versioning
Special Thanks to @sohelamin for the Review.
v1.1.0
What's Changed
- Fixed #1 Replace the first name arrow with space.
- Fixed showing wrong passport number (0f66162:)
- Validate given date format in MRZ (ede0247)
New Contributors
- @alaminfirdows made their first contribution in #2
Full Changelog: v1.0...v1.1