From 74875f05d71f5a374d9ed40ed47f25cba2d5b2ba Mon Sep 17 00:00:00 2001 From: Mark Scherer Date: Sun, 11 Oct 2026 19:28:02 +0200 Subject: [PATCH] Correct the toInt() upgrade note The 1.x column claimed that toInt() with a rounding mode is not available. 1.4 accepts the call and ignores the argument, which lets callers switch before upgrading. The license header template is also kept out of the dist. --- .gitattributes | 1 + docs/reference/upgrading.md | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 2d22c2b..d1e5648 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,6 +11,7 @@ .env export-ignore .gitattributes export-ignore .gitignore export-ignore +.license export-ignore phpcs.xml export-ignore phpstan.neon export-ignore phpunit.xml.dist export-ignore diff --git a/docs/reference/upgrading.md b/docs/reference/upgrading.md index fa9f842..809295b 100644 --- a/docs/reference/upgrading.md +++ b/docs/reference/upgrading.md @@ -93,7 +93,9 @@ See the [exception table](./api#exceptions). | --- | --- | --- | | `Decimal::create('23.74')->toInt()` | `23` | `RoundingNecessaryException` | | `Decimal::create('23.00')->toInt()` | `23` | `23` | -| `Decimal::create('23.74')->toInt(Decimal::ROUND_DOWN)` | not available | `23` | +| `Decimal::create('23.74')->toInt(Decimal::ROUND_DOWN)` | `23` | `23` | + +1.4 ignores the argument, so calls can be changed before the upgrade. `toFloat()` returns the nearest float for any value in the float range. It used to throw for values with long fractions.