Repository navigation
Merge master into next - #33
Merged
Merged
Conversation
Correct decimal documentation and add verified site checks
Brings the documentation corrections, the docs build check in CI and the 1.4.1 and 1.4.2 notes to next. The comparison fix from master is not taken over. It covers a value that holds more decimals than its scale, which 2.0 refuses to create, so its test is dropped and compareTo() stays as it is. Docblock and docs wording is adapted where master describes 1.x behavior: create() returns the same instance, round() always yields the requested scale, mod() is exact without a scale argument.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #33 +/- ##
=========================================
Coverage 95.81% 95.81%
Complexity 201 201
=========================================
Files 1 1
Lines 454 454
=========================================
Hits 435 435
Misses 19 19 ☔ 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.
Merges
master(1.4.1 plus #32) intonext, so 2.0 has the documentation corrections and the docs build check in CI.Taken over
DocumentationCI job, read-only workflow permissions and disabled checkout credentials.Decimal.phpforequals(),isZero(),isNegative(),isPositive(),pow()andmod().Not taken over
The comparison fix from #32. It covers a value that holds more decimals than its scale, such as
Decimal::create('1.9', 0). 2.0 refuses to create that value with aRoundingNecessaryException, socompareTo()stays as it is and the test for it is dropped.Adapted for 2.0
Where
masterdescribes 1.x behavior, the text follows whatnextdoes:create()returns aDecimalof the called class as is, wheremastersays it clones.round()always yields the requested scale. The note on legacyROUND_FLOORandROUND_CEILbehavior is left out.rem($value)maps tomod($value), which is exact without a scale argument, andDecimal::avg()maps toaverage($values, $scale, $roundMode).0, strict mode and the "Coming in 2.0" table stay out. The 2.0 upgrade section covers them.tryCreate()returningnullfor negative scales is left out: onnexta negative scale throws.