From 7e816a861c0d3ae550a8eedcf3c9f1c546e6bd35 Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Sat, 27 Jan 2024 20:17:11 +0100 Subject: [PATCH] chore: psalm simplify positive-int|0 to non-negative-int (for src) --- src/Currencies/CryptoCurrencies.php | 6 +++--- src/Currencies/CurrencyList.php | 2 +- src/Currencies/ISOCurrencies.php | 6 +++--- src/Money.php | 2 +- src/Number.php | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Currencies/CryptoCurrencies.php b/src/Currencies/CryptoCurrencies.php index e57911ed..98542cb6 100644 --- a/src/Currencies/CryptoCurrencies.php +++ b/src/Currencies/CryptoCurrencies.php @@ -25,7 +25,7 @@ final class CryptoCurrencies implements Currencies * * @psalm-var non-empty-array|null */ private static ?array $currencies = null; @@ -64,7 +64,7 @@ static function ($code) { * * @psalm-return non-empty-array */ private function getCurrencies(): array @@ -79,7 +79,7 @@ private function getCurrencies(): array /** * @psalm-return non-empty-array */ private function loadCurrencies(): array diff --git a/src/Currencies/CurrencyList.php b/src/Currencies/CurrencyList.php index 8c2f37be..cede99f6 100644 --- a/src/Currencies/CurrencyList.php +++ b/src/Currencies/CurrencyList.php @@ -25,7 +25,7 @@ final class CurrencyList implements Currencies */ private array $currencies; - /** @psalm-param array $currencies */ + /** @psalm-param array $currencies */ public function __construct(array $currencies) { $this->currencies = $currencies; diff --git a/src/Currencies/ISOCurrencies.php b/src/Currencies/ISOCurrencies.php index f2890b31..486b06ab 100644 --- a/src/Currencies/ISOCurrencies.php +++ b/src/Currencies/ISOCurrencies.php @@ -26,7 +26,7 @@ final class ISOCurrencies implements Currencies * @psalm-var non-empty-array|null */ @@ -81,7 +81,7 @@ static function ($code) { * @psalm-return non-empty-array */ @@ -98,7 +98,7 @@ private function getCurrencies(): array * @psalm-return non-empty-array */ diff --git a/src/Money.php b/src/Money.php index fbbf3957..a3654dc7 100644 --- a/src/Money.php +++ b/src/Money.php @@ -399,7 +399,7 @@ private function round(string $amount, int $roundingMode): string /** * Round to a specific unit. * - * @psalm-param positive-int|0 $unit + * @psalm-param non-negative-int $unit * @psalm-param self::ROUND_* $roundingMode */ public function roundToUnit(int $unit, int $roundingMode = self::ROUND_HALF_UP): self diff --git a/src/Number.php b/src/Number.php index c34ce11a..ab6cdd9e 100644 --- a/src/Number.php +++ b/src/Number.php @@ -264,7 +264,7 @@ public static function roundMoneyValue(string $moneyValue, int $targetDigits, in if ($shouldRound && $moneyValue[$valueLength - $havingDigits + $targetDigits] >= 5) { $position = $valueLength - $havingDigits + $targetDigits; - /** @psalm-var positive-int|0 $addend */ + /** @psalm-var non-negative-int $addend */ $addend = 1; while ($position > 0) {