-
Notifications
You must be signed in to change notification settings - Fork 8
Type Casts added #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Type Casts added #22
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22 +/- ##
=========================================
Coverage 94.37% 94.37%
Complexity 103 103
=========================================
Files 1 1
Lines 231 231
=========================================
Hits 218 218
Misses 13 13
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@dereuromark The phpstan grumbles because of the return value from preg_replace in function fromScientific and I added a check that the result value must be a string and not an array nor null. But now I have to add an codeCoverageStart / End because the codecov was the next tool which has grumbled now. Should I revoke the check? |
@@ -831,7 +831,7 @@ protected function fromScientific(string $value, ?int $scale): void | |||
} else { | |||
$this->integralPart = bcmul($matches[2], bcpow('10', (string)$exp)); | |||
|
|||
$pos = strlen((string)$this->integralPart); | |||
$pos = strlen($this->integralPart); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we remove the string cast here, shouldnt we also remove it in line 841?
decimal-object/src/Decimal.php
Line 841 in b9c5d21
$this->fractionalPart = str_pad($this->fractionalPart, $scale - strlen((string)$this->integralPart), '0'); |
@gechetspr will have to check and merge. Looks good to me. |
PR Description
Checklist