Skip to content

Commit

Permalink
Merge pull request #10379 from kkmuffme/update-decimal-stubs
Browse files Browse the repository at this point in the history
update decimal stubs from documented URL
  • Loading branch information
orklah committed Nov 18, 2023
2 parents 44a0d4c + fdbd9b1 commit 98851b5
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions stubs/extensions/decimal.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ namespace Decimal;

/**
* Copied from https://github.com/php-decimal/stubs/blob/master/Decimal.php
* with prefixed param replaced regular param using regex:
* @(?:psalm|phpstan)-param (.+?) (\$\w+)[^@]+?@param .+?\2
* @param $1 $2
*
* The MIT License (MIT)
* Copyright (c) 2018 Rudi Theunissen
Expand Down Expand Up @@ -52,8 +55,8 @@ final class Decimal implements \JsonSerializable
*
* Initializes a new instance using a given value and minimum precision.
*
* @param Decimal|string|int $value
* @param int $precision
* @param Decimal|numeric-string|int $value
* @param int $precision
*
* @throws \BadMethodCallException if already constructed.
* @throws \TypeError if the value is not a decimal, string, or integer.
Expand Down Expand Up @@ -119,7 +122,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $value
* @param Decimal|numeric-string|int $value
*
* @return Decimal the result of adding this decimal to the given value.
*
Expand All @@ -135,7 +138,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $value
* @param Decimal|numeric-string|int $value
*
* @return Decimal the result of subtracting a given value from this decimal.
*
Expand All @@ -151,7 +154,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $value
* @param Decimal|numeric-string|int $value
*
* @return Decimal the result of multiplying this decimal by the given value.
*
Expand All @@ -167,7 +170,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $value
* @param Decimal|numeric-string|int $value
*
* @return Decimal the result of dividing this decimal by the given value.
*
Expand All @@ -187,7 +190,7 @@ final class Decimal implements \JsonSerializable
*
* @see Decimal::rem for the decimal remainder.
*
* @param Decimal|string|int $value
* @param Decimal|numeric-string|int $value
*
* @return Decimal the remainder after dividing the integer value of this
* decimal by the integer value of the given value
Expand All @@ -204,7 +207,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $value
* @param Decimal|numeric-string|int $value
*
* @return Decimal the remainder after dividing this decimal by a given value.
*
Expand All @@ -222,7 +225,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision
* and the given value's precision, where scalar values assume the default.
*
* @param Decimal|string|int $exponent The power to raise this decimal to.
* @param Decimal|numeric-string|int $exponent The power to raise this decimal to.
*
* @return Decimal the result of raising this decimal to a given power.
*
Expand Down Expand Up @@ -488,5 +491,5 @@ final class Decimal implements \JsonSerializable
*
* @return string
*/
public function jsonSerialize() {}
public function jsonSerialize(): string {}
}

0 comments on commit 98851b5

Please sign in to comment.