Skip to content

Support brick/money 0.14 - #3

Merged
robertvansteen merged 1 commit into
mainfrom
brick-money
Aug 5, 2026
Merged

robertvansteen merged 1 commit into
mainfrom
brick-money

Conversation

@robertvansteen

Copy link
Copy Markdown
Collaborator

Moves brick/money from ^0.10.1 to ^0.14.1, which is what a consumer on a current framework needs.

brick removed two APIs this package relied on:

  • Currency::is() is gone in favour of isEqualTo().
  • Money comparisons no longer accept floats, so the float member is dropped from the four endpoint comparison signatures. A float was never a safe way to ask a monetary question; callers pass Money, BigNumber, int, or a numeric string.

That signature change is why the release is 0.2.0.

-        Assert::true($left->getCurrency()->is($this->right->getCurrency()), ...);
+        Assert::true($left->getCurrency()->isEqualTo($this->right->getCurrency()), ...);

Two fixes fall out of the newer toolchain:

  • leftEndpoint / rightEndpoint always exist, because the trailing group closingSymbol is always matched, so the ?? null on each was dead. Unmatched groups arrive as '' and the emptiness checks below already handle that.
  • isEqualTo compared three components but no test varied a single endpoint, leaving a surviving mutant that weakened the endpoint conjunction to a disjunction. Two assertions now pin intervals that share one endpoint and differ in the other.

PHPUnit is capped below 12.5.12, which rejects the -d --min-coverage form phpunit-coverage-tools documents for its threshold.

Verified: PHPStan clean, 62 tests, 100% coverage, MSI 100%.

brick/money removed two APIs this package relied on. Currency::is() is gone in
favour of isEqualTo(), and money comparisons no longer accept floats — so the
float member is dropped from the four endpoint comparison signatures. A float
was never a safe way to ask a monetary question; callers pass Money, BigNumber,
int or a numeric string.

Two unrelated fixes fall out of the newer toolchain:

- The named groups leftEndpoint and rightEndpoint always exist, because the
  trailing group closingSymbol is always matched, so the ?? null on each was
  dead. Unmatched groups arrive as '' and the emptiness checks below already
  handle that.
- isEqualTo compared three components but no test varied a single endpoint,
  leaving a surviving mutant that weakened the endpoint conjunction to a
  disjunction. Two assertions now pin intervals that share one endpoint and
  differ in the other.

PHPUnit is pinned because 12.5.33 rejects the "-d --min-coverage" form that
phpunit-coverage-tools documents for its coverage threshold.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@robertvansteen
robertvansteen merged commit ca53365 into main Aug 5, 2026
6 checks passed
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