Repository navigation
6.6.0
·
67 commits
to 6.x
since this release
Immutable
release. Only release title and notes can be modified.
Opt-in consistency checks for statements and transfers (validate()), exact amounts as decimal strings (getAmount(true)), and ParseException messages without account numbers or labels.
Added
Statement::validate()andTransfer::validate()check the consistency of a statement or a transfer, which the
readers do not: they throw aValidationException(aParseException) whosegetCheck()tells which
ValidationCheckfailed. Opt-in: call them on the statements and transfers you need to trust- CFONB 120: the
07new balance, the04operations and their05details belong to the account of the01old
balance (desk code, account number, currency; bank code between the two balances only), and the new balance is
the old balance plus the operations - CFONB 240: the
39total belongs to the account of the31header (bank code, counter code, account number,
currency index), the34transactions have its currency index, and the total is the sum of the transactions - The amounts are added as integers in minor units, never as floats
- CFONB 120: the
- Exact amounts, as decimal strings: pass
truetoBalance::getAmount(),Operation::getAmount(),
Transaction::getTransactionAmount()andTotal::getTotalAmount().getAmount(true)is"-22.79", with the
number of decimals of the line ("1669565"with 0 decimals), ready for aDECIMALcolumn or bcmath; the float loses
cents,(int) (0.29 * 100)being28. The return type follows the argument for PHPStan and Psalm (floatby
default,stringwithtrue). The objects keep the amount as this string and compute the float from it, the same
float as before. Their constructors take the amount asfloat|string: a float becomes the decimal string that gives
it back,1669.565staying"1669.565", and a string that is not a decimal throws anInvalidArgumentException ParseException::getRawContent(): the line (or, for an amount, the field) that failed to parse, now kept out of the
message
Changed
- The messages of a
ParseExceptionno longer hold the line that failed, which holds account numbers and labels and
ended up in logs and error pages. Code matching the full message must be updated; the beginning of the messages is
unchanged:Unable to find a parser for the line :+ the line is nowUnable to find a parser for the line 3: record code "04", 119 charactersRegex does not match the line "…"is nowRegex does not match the line: the field "amount" at position 91 is invalidUnable to parse amount "…"is nowUnable to parse amount: its last character "…" is not a sign character
Deprecated
- The float returned by
getAmount(),getTransactionAmount()andgetTotalAmount()without an argument: 7.0 returns
the exact decimal string only. Passtrueto get it now
What's Changed
- chore: switch from Yarn classic to pnpm by @guillaume-sainthillier in #376
- chore(deps): update pnpm to v12.13.0 by @renovate[bot] in #377
- chore(deps): weekly dependency update by @guillaume-sainthillier in #378
- chore(deps): update pnpm to v12.14.0 by @renovate[bot] in #380
- chore(deps): update dependency astro to v7.4.1 by @renovate[bot] in #379
- fix(deps): update dependency @silarhi/docs-kit to ^0.7.0 by @renovate[bot] in #381
- fix(deps): update dependency @silarhi/docs-kit to ^0.8.0 by @guillaume-sainthillier in #382
- chore(deps): update dependency astro to v7.4.2 by @renovate[bot] in #383
- chore(deps): update pnpm to v12.15.0 by @renovate[bot] in #384
- chore(deps): weekly dependency update 2026-10-26 by @guillaume-sainthillier in #385
- feat: add statement validation and exact amounts, keep raw lines out of messages by @guillaume-sainthillier in #386
Full Changelog: 6.5.0...6.6.0