Skip to content

[5.x] Upgrade brick/math to support versions ^0.14.2–^0.17#634

Open
balu-lt wants to merge 2 commits intoramsey:5.xfrom
balu-lt:brick-math
Open

[5.x] Upgrade brick/math to support versions ^0.14.2–^0.17#634
balu-lt wants to merge 2 commits intoramsey:5.xfrom
balu-lt:brick-math

Conversation

@balu-lt
Copy link
Copy Markdown

@balu-lt balu-lt commented Mar 12, 2026

Description

This PR upgrades the brick/math dependency and updates the codebase to use the new rounding mode constants introduced in version 0.14.2.

Key changes:

  • Migrated all usages of Brick\Math\RoundingMode constants from SCREAMING_SNAKE_CASE (deprecated) to PascalCase (e.g., HALF_UP -> HalfUp).
  • Updated composer.json to require brick/math: ^0.14.2 || ^0.15 || ^0.16 || ^0.17.
  • Updated CI workflow to test against the new minimum version (0.14.2).
  • Adjusted BrickMathCalculatorTest to handle variations in exception messages between different brick/math versions.
  • Refactored Ramsey\Uuid\Type\Time::toString() to ensure it returns a numeric-string, addressing a PHPStan static analysis error.

Motivation and context

brick/math 0.14.2 introduced PascalCase constants and deprecated the old ones. The old constants are removed in version 0.15. This update ensures the library remains compatible with current and future versions of the dependency. Additionally, it fixes a type-hinting issue reported by PHPStan in the Time class.

How has this been tested?

  • Ran unit tests via vendor/bin/phpunit to ensure all functionality remains intact.
  • Ran PHPStan static analysis via composer dev:analyze to verify the fix in src/Type/Time.php.
  • Verified compatibility with the new minimum version of brick/math (0.14.2) in the CI environment.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

PR checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.

@balu-lt balu-lt requested a review from ramsey as a code owner March 12, 2026 13:03
@balu-lt balu-lt changed the title Upgrade brick/math to support versions ^0.14.2, ^0.15, and ^0.16 [5.x] Upgrade brick/math to support versions ^0.14.2, ^0.15, and ^0.16 Mar 12, 2026
@balu-lt balu-lt changed the title [5.x] Upgrade brick/math to support versions ^0.14.2, ^0.15, and ^0.16 [5.x] Upgrade brick/math to support versions ^0.14.2–^0.17 Mar 19, 2026
@WoBBeLnl
Copy link
Copy Markdown

@ramsey really sorry to bother you but is it possible to merge this anytime soon? There are multiple PR open for the same issue, one starting february. If you need any help please let me know!

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.

2 participants