-
Notifications
You must be signed in to change notification settings - Fork 650
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
Mark return values in throw
arguments as used
#5989
Mark return values in throw
arguments as used
#5989
Conversation
@@ -940,6 +940,7 @@ public static function verifyType( | |||
|| $context->inside_use | |||
|| $context->inside_assignment | |||
|| $context->inside_conditional | |||
|| $context->inside_throw |
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.
I'm not sure whether I really needed to add $context->inside_throw
to all of these places, but no tests broke 🤷♂️
throw
argument as usedthrow
arguments as used
Thanks! |
This method still errors. Why? /** @psalm-pure */
public static function divide(string $amount, string $divisor): string
{
if (bccomp($divisor, '0', self::SCALE) === 0) {
throw InvalidArgumentException::divisionByZero();
}
return bcdiv($amount, $divisor, self::SCALE);
}
|
@frederikbosch is it used, and if so, where? |
Also, I don't think this has anything to do with |
It seems used at least here: https://github.com/moneyphp/money/blob/2f882263c73d75ddbea49244da5425a9c18289fb/src/Money.php#L265 Also in tests: https://github.com/moneyphp/money/blob/4f9c4fa10f7615a5d7f0c25de6658e0479957be9/tests/Calculator/GmpCalculatorTest.php#L55 and I checked, the @frederikbosch can you create a new issue for this? |
Fixes #5975