Repository navigation
Prepare the next branch for 2.0 - #29
Merged
Merged
Conversation
Both methods typed their operand as self|string|int. For a caller that does not declare strict types, PHP converts a float to an integer before the method runs, so mod(2.5) calculated mod 2 and pow(0.5) calculated the power of 0. The only sign was a PHP deprecation notice. Callers with strict types got a TypeError instead. The types now list float, like every other operation. mod() handles it as the value it is, and pow() reports a fractional exponent with the same error a string such as '0.5' already produced. tests/data/float_operands.php has no strict_types on purpose, to exercise the call the way an affected caller makes it.
Stop mod() and pow() from truncating float operands
Float operands are rejected on this branch, so the float tests from master now assert that instead of the 1.x results.
Alias the branch as 2.x-dev so dependents can require it, run CI on pushes to it, and drop ext-json, which is always part of PHP 8. The README names the 1.4 releases for the 1.x API, and renovate.json stays out of the dist.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #29 +/- ##
=========================================
Coverage 95.59% 95.59%
Complexity 201 201
=========================================
Files 1 1
Lines 454 454
=========================================
Hits 434 434
Misses 20 20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings
nextin line withmasterand gets the branch ready for the 2.0 release.master, which carries the 1.4.1 fix for float operands inmod()andpow(). Floats are rejected on this branch, so the tests from that fix now assert the rejection, including the call from a file withoutstrict_types. Source and docs keep the 2.0 versions.dev-nextbranch alias2.x-dev, so dependents can require^2.0as a dev version without an inline alias.next. Until now only pull requests against it were checked.ext-jsonfromrequire. The extension has been part of PHP itself since 8.0.renovate.jsonout of the dist archive.Not included: the docs site still deploys from
masteronly, so it shows the 1.x docs untilnextis merged.