Skip to content

3.0.0

Latest

Choose a tag to compare

@robertogallea robertogallea released this 12 Aug 08:03
· 1 commit to main since this release

3.0 is a ground-up rewrite, and an intentional, clean break from 2.x with no compatibility shims. See UPGRADE.md for a complete call-by-call migration table.

Added

  • A small, framework-agnostic domain core (Robertogallea\CodiceFiscale) with no Laravel dependency, separate from a Robertogallea\CodiceFiscale\Laravel integration layer.
  • An immutable CodiceFiscale value object, constructed via from()/tryFrom(), that can only ever hold a structurally valid code.
  • Generator, taking a Person DTO (real DateTimeImmutable, BirthPlaceCode, Gender enum) instead of loosely-typed positional arguments.
  • Parser, decoding a CodiceFiscale into surnameCode()/nameCode() (honestly named as encoded fragments, not real names), birth date/gender/birthplace, with automatic reference-date resolution of the ambiguous two-digit birth year.
  • Validator, with independently-callable format/checksum/semantics tiers and a ValidationResult carrying every applicable ValidationError, instead of one exception at a time.
  • Matcher, comparing a CodiceFiscale against a Person/PartialPerson and reporting matched/mismatched/skipped fields explicitly.
  • Omocodia, exposing canonical(), variants() (all 128 combinations), and isEquivalentTo().
  • A BirthPlace domain backed by real ANPR (Italian municipalities) and MAECI (foreign countries) government data, with genuine historical validity windows - a renamed or merged municipality now resolves correctly against a birth date from before the change.
  • A codice-fiscale:update-places artisan command that downloads both datasets into the consuming application's own dedicated SQLite database - never bundled with the package, never touching the host application's primary database.
  • CodiceFiscaleCast (Eloquent attribute casting), CodiceFiscaleRule::make()->matching(...) (fluent cross-field validation), and a Faker provider - all rebuilt on the new core API.
  • Restored, localized (en/it) validation error messages.

Removed

  • The entire 2.x API (robertogallea\LaravelCodiceFiscale\*) - no backward-compatibility shims. See UPGRADE.md.
  • Bundled birthplace data - nobody had verified the redistribution terms of the source datasets, so shipping a converted copy meant redistributing it under this package's own unverified authority.

Note for early adopters

If you were requiring the pre-release dev-dev branch directly, switch to ^3.0 now that a tagged release exists.