Skip to content

Release 2.7.0: plaintext comparison for encrypted fields, Flatten with InferRules, FloatCast finite, PHPStan level 6 - #14

Merged
yuriizee merged 1 commit into
mainfrom
release/2.7.0
Oct 16, 2026
Merged

yuriizee merged 1 commit into
mainfrom
release/2.7.0

Conversation

@yuriizee

Copy link
Copy Markdown
Contributor

Fixed

  • equals(), diff(), DataObjectCast::compare() and DataCollectionCast::compare() compare EncryptedCast fields by their decrypted value. Equal objects no longer differ because each toArray() draws a new nonce, and saving an unchanged model no longer rewrites the encrypted column. diff() still reports ciphertexts, never plaintext (S1-09).
  • A required #[Flatten] property under #[InferRules] rejected valid flat input ("address is required"); the nested rules now apply to the parent's own keys. Nullable/defaulted #[Flatten] keeps the prefixed rules (S3-F16).

Added (opt-in)

  • FloatCast(finite: true) rejects INF / NAN (e.g. 1e400 in JSON) at hydration (S3-F11).

Changed

  • PHPStan level 6: array, iterable and generic types documented across src; fixtures exempt from missingType.*.
  • Docs: XML entity handling (DTD entities are never expanded) (S3-F17), comparison of encrypted and hidden fields.

Performance

  • Hydration/serialization benchmarks, interleaved before/after: medians within ±2.2% (noise), memory identical.
  • equals() 615 → 603 ns; diff() +1–4% (one static property read). The plaintext pass runs only when the compared objects actually encrypted something.

Verification

  • Docker: 887 tests, 100% line coverage (2173/2173); PHPStan level 6 clean; Infection covered MSI 86%.

Backward compatible with 2.6.x.

…h InferRules, FloatCast finite, PHPStan level 6

- equals(), diff() and the Eloquent casts compare EncryptedCast fields by
  their decrypted value; diff() still reports ciphertexts. Saving an
  unchanged model no longer rewrites the encrypted column.
- A required #[Flatten] property under #[InferRules] no longer demands a
  key that never exists; the nested rules apply to the parent's keys.
- FloatCast(finite: true) rejects INF and NAN (opt-in).
- PHPStan level 6 with array, iterable and generic types across src.
- Docs: XML entity handling, comparison of encrypted and hidden fields.
@yuriizee
yuriizee merged commit 72d3ee9 into main Oct 16, 2026
6 checks passed
@yuriizee
yuriizee deleted the release/2.7.0 branch October 16, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant