1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

fix prefixed param and document it

This commit is contained in:
kkmuffme 2023-11-18 08:10:44 +01:00
parent e9b0103c7f
commit fdbd9b133c

View File

@ -3,6 +3,9 @@ namespace Decimal;
/** /**
* Copied from https://github.com/php-decimal/stubs/blob/master/Decimal.php * 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) * The MIT License (MIT)
* Copyright (c) 2018 Rudi Theunissen * Copyright (c) 2018 Rudi Theunissen
@ -52,8 +55,7 @@ final class Decimal implements \JsonSerializable
* *
* Initializes a new instance using a given value and minimum precision. * Initializes a new instance using a given value and minimum precision.
* *
* @psalm-param Decimal|numeric-string|int $value * @param Decimal|numeric-string|int $value
* @param Decimal|string|int $value
* @param int $precision * @param int $precision
* *
* @throws \BadMethodCallException if already constructed. * @throws \BadMethodCallException if already constructed.
@ -120,8 +122,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision * 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. * and the given value's precision, where scalar values assume the default.
* *
* @psalm-param Decimal|numeric-string|int $value * @param Decimal|numeric-string|int $value
* @param Decimal|string|int $value
* *
* @return Decimal the result of adding this decimal to the given value. * @return Decimal the result of adding this decimal to the given value.
* *
@ -137,8 +138,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision * 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. * and the given value's precision, where scalar values assume the default.
* *
* @psalm-param Decimal|numeric-string|int $value * @param Decimal|numeric-string|int $value
* @param Decimal|string|int $value
* *
* @return Decimal the result of subtracting a given value from this decimal. * @return Decimal the result of subtracting a given value from this decimal.
* *
@ -154,8 +154,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision * 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. * and the given value's precision, where scalar values assume the default.
* *
* @psalm-param Decimal|numeric-string|int $value * @param Decimal|numeric-string|int $value
* @param Decimal|string|int $value
* *
* @return Decimal the result of multiplying this decimal by the given value. * @return Decimal the result of multiplying this decimal by the given value.
* *
@ -171,8 +170,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision * 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. * and the given value's precision, where scalar values assume the default.
* *
* @psalm-param Decimal|numeric-string|int $value * @param Decimal|numeric-string|int $value
* @param Decimal|string|int $value
* *
* @return Decimal the result of dividing this decimal by the given value. * @return Decimal the result of dividing this decimal by the given value.
* *
@ -192,8 +190,7 @@ final class Decimal implements \JsonSerializable
* *
* @see Decimal::rem for the decimal remainder. * @see Decimal::rem for the decimal remainder.
* *
* @psalm-param Decimal|numeric-string|int $value * @param Decimal|numeric-string|int $value
* @param Decimal|string|int $value
* *
* @return Decimal the remainder after dividing the integer value of this * @return Decimal the remainder after dividing the integer value of this
* decimal by the integer value of the given value * decimal by the integer value of the given value
@ -210,8 +207,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision * 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. * and the given value's precision, where scalar values assume the default.
* *
* @psalm-param Decimal|numeric-string|int $value * @param Decimal|numeric-string|int $value
* @param Decimal|string|int $value
* *
* @return Decimal the remainder after dividing this decimal by a given value. * @return Decimal the remainder after dividing this decimal by a given value.
* *
@ -229,8 +225,7 @@ final class Decimal implements \JsonSerializable
* The precision of the result will be the max of this decimal's precision * 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. * and the given value's precision, where scalar values assume the default.
* *
* @psalm-param Decimal|numeric-string|int $exponent The power to raise this decimal to. * @param Decimal|numeric-string|int $exponent The power to raise this decimal to.
* @param Decimal|string|int $exponent The power to raise this decimal to.
* *
* @return Decimal the result of raising this decimal to a given power. * @return Decimal the result of raising this decimal to a given power.
* *