Skip to content

Releases: rakibdevs/mrz-parser

v2.0.0

Choose a tag to compare

@rakibdevs rakibdevs released this 01 Jul 17:38
11e2fe6

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\DocumentType is now a real backed enum instead of an abstract class with constants.

Added

  • ICAO 9303 check-digit validation. Each result exposes an overall valid flag plus a per-field validation map (document number, date of birth, date of expiry, personal number, and composite).
  • Richer output: raw ISO alpha-3 codes (issuer_code, nationality_code), raw sex character, optional_data, and the normalized raw MRZ string.
  • Typed MrzResult object via MrzParser::read() — typed properties, dateOfBirthAsDate()/dateOfExpiryAsDate(), isExpired(), fullName(), and toArray().
  • Non-throwing entry points MrzParser::tryParse() and MrzParser::tryRead() returning null on invalid input.
  • Strict check-digit mode (parse($text, strict: true)) throwing InvalidChecksumException when a check digit fails.
  • Name transliteration (Support\Transliterator): fromLatin() and matches() for converting/comparing accented names against the MRZ.
  • French national ID (2×36 legacy format) support.
  • Laravel integration: auto-discovered service provider and a ValidMrz validation 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

Full Changelog: v1.2.0...v2.0.0

v1.2.0

Choose a tag to compare

@rakibdevs rakibdevs released this 30 Jun 05:33

Full Changelog: v1.1.0...v1.2.0

  1. Fixed Card No and First Name "<" Issue in Visa b292c6a
  2. Added Semantic Versioning

Special Thanks to @sohelamin for the Review.

v1.1.0

Choose a tag to compare

@rakibdevs rakibdevs released this 29 Jun 03:52
3db4020

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

Full Changelog: v1.0...v1.1

v1.0.0

Choose a tag to compare

@rakibdevs rakibdevs released this 26 Jun 19:04
3db4020

Extract information from Machine Readable Zone data for Passport, Visa, and Other Travel Documents.