Skip to content

Commit

Permalink
Merge branch 'master' into feature/bump-dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris53897 committed Feb 2, 2024
2 parents 1e2523b + 4c1a502 commit 44c23c7
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"ext-intl": "*",
"cache/taggable-cache": "^1.1.0",
"doctrine/coding-standard": "^12.0",
"doctrine/coding-standard": "^9.0",
"doctrine/instantiator": "^1.5.0 || ^2.0",
"florianv/exchanger": "^2.8.1",
"florianv/swap": "^4.3.0",
Expand Down
6 changes: 3 additions & 3 deletions src/Currencies/CryptoCurrencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class CryptoCurrencies implements Currencies
*
* @psalm-var non-empty-array<non-empty-string, array{
* symbol: non-empty-string,
* minorUnit: positive-int|0
* minorUnit: non-negative-int
* }>|null
*/
private static array|null $currencies = null;
Expand Down Expand Up @@ -62,7 +62,7 @@ static function ($code) {
*
* @psalm-return non-empty-array<non-empty-string, array{
* symbol: non-empty-string,
* minorUnit: positive-int|0
* minorUnit: non-negative-int
* }>
*/
private function getCurrencies(): array
Expand All @@ -77,7 +77,7 @@ private function getCurrencies(): array
/**
* @psalm-return non-empty-array<non-empty-string, array{
* symbol: non-empty-string,
* minorUnit: positive-int|0
* minorUnit: non-negative-int
* }>
*/
private function loadCurrencies(): array
Expand Down
2 changes: 1 addition & 1 deletion src/Currencies/CurrencyList.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class CurrencyList implements Currencies
*/
private array $currencies;

/** @psalm-param array<non-empty-string, positive-int|0> $currencies */
/** @psalm-param array<non-empty-string, non-negative-int> $currencies */
public function __construct(array $currencies)
{
$this->currencies = $currencies;
Expand Down
6 changes: 3 additions & 3 deletions src/Currencies/ISOCurrencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class ISOCurrencies implements Currencies
* @psalm-var non-empty-array<non-empty-string, array{
* alphabeticCode: non-empty-string,
* currency: non-empty-string,
* minorUnit: positive-int|0,
* minorUnit: non-negative-int,
* numericCode: positive-int
* }>|null
*/
Expand Down Expand Up @@ -79,7 +79,7 @@ static function ($code) {
* @psalm-return non-empty-array<non-empty-string, array{
* alphabeticCode: non-empty-string,
* currency: non-empty-string,
* minorUnit: positive-int|0,
* minorUnit: non-negative-int,
* numericCode: positive-int
* }>
*/
Expand All @@ -96,7 +96,7 @@ private function getCurrencies(): array
* @psalm-return non-empty-array<non-empty-string, array{
* alphabeticCode: non-empty-string,
* currency: non-empty-string,
* minorUnit: positive-int|0,
* minorUnit: non-negative-int,
* numericCode: positive-int
* }>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,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
Expand Down
2 changes: 1 addition & 1 deletion src/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
30 changes: 15 additions & 15 deletions tests/ConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ final class ConverterTest extends TestCase
/**
* @psalm-param non-empty-string $baseCurrencyCode
* @psalm-param non-empty-string $counterCurrencyCode
* @psalm-param positive-int|0 $subunitBase
* @psalm-param positive-int|0 $subunitCounter
* @psalm-param non-negative-int $subunitBase
* @psalm-param non-negative-int $subunitCounter
* @psalm-param int|float $ratio
* @psalm-param positive-int|numeric-string $amount
* @psalm-param positive-int|0 $expectedAmount
* @psalm-param non-negative-int $expectedAmount
*
* @dataProvider convertExamples
* @test
Expand Down Expand Up @@ -74,11 +74,11 @@ public function itConvertsToADifferentCurrency(
/**
* @psalm-param non-empty-string $baseCurrencyCode
* @psalm-param non-empty-string $counterCurrencyCode
* @psalm-param positive-int|0 $subunitBase
* @psalm-param positive-int|0 $subunitCounter
* @psalm-param non-negative-int $subunitBase
* @psalm-param non-negative-int $subunitCounter
* @psalm-param int|float $ratio
* @psalm-param positive-int|numeric-string $amount
* @psalm-param positive-int|0 $expectedAmount
* @psalm-param non-negative-int $expectedAmount
*
* @dataProvider convertExamples
* @test
Expand Down Expand Up @@ -127,11 +127,11 @@ public function itConvertsAndReturnWithCurrencyPair(
/**
* @psalm-param non-empty-string $baseCurrencyCode
* @psalm-param non-empty-string $counterCurrencyCode
* @psalm-param positive-int|0 $subunitBase
* @psalm-param positive-int|0 $subunitCounter
* @psalm-param non-negative-int $subunitBase
* @psalm-param non-negative-int $subunitCounter
* @psalm-param int|float $ratio
* @psalm-param positive-int|numeric-string $amount
* @psalm-param positive-int|0 $expectedAmount
* @psalm-param non-negative-int $expectedAmount
*
* @dataProvider convertExamples
* @test
Expand Down Expand Up @@ -174,11 +174,11 @@ public function itConvertsAgainstCurrencyPair(
/**
* @psalm-param non-empty-string $baseCurrencyCode
* @psalm-param non-empty-string $counterCurrencyCode
* @psalm-param positive-int|0 $subunitBase
* @psalm-param positive-int|0 $subunitCounter
* @psalm-param non-negative-int $subunitBase
* @psalm-param non-negative-int $subunitCounter
* @psalm-param int|float $ratio
* @psalm-param positive-int|numeric-string $amount
* @psalm-param positive-int|0 $expectedAmount
* @psalm-param non-negative-int $expectedAmount
*
* @dataProvider convertExamples
* @test
Expand Down Expand Up @@ -222,11 +222,11 @@ public function itThrowsWhenConvertingAgainstTheWrongBaseCurrency(): void
* @psalm-return non-empty-list<array{
* non-empty-string,
* non-empty-string,
* positive-int|0,
* positive-int|0,
* non-negative-int,
* non-negative-int,
* int|float,
* positive-int|numeric-string,
* positive-int|0
* non-negative-int
* }>
*/
public function convertExamples(): array
Expand Down
4 changes: 2 additions & 2 deletions tests/Formatter/BitcoinMoneyFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class BitcoinMoneyFormatterTest extends TestCase
/**
* @psalm-param positive-int $value
* @psalm-param non-empty-string $formatted
* @psalm-param positive-int|0 $fractionDigits
* @psalm-param non-negative-int $fractionDigits
*
* @dataProvider bitcoinExamples
* @test
Expand All @@ -41,7 +41,7 @@ public function itFormatsMoney(int $value, string $formatted, int $fractionDigit
* @psalm-return non-empty-list<array{
* positive-int,
* non-empty-string,
* positive-int|0
* non-negative-int
* }>
*/
public function bitcoinExamples(): array
Expand Down
4 changes: 2 additions & 2 deletions tests/Formatter/DecimalMoneyFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class DecimalMoneyFormatterTest extends TestCase
{
/**
* @psalm-param non-empty-string $currency
* @psalm-param positive-int|0 $subunit
* @psalm-param non-negative-int $subunit
* @psalm-param numeric-string $result
*
* @dataProvider moneyExamples
Expand All @@ -39,7 +39,7 @@ public function itFormatsMoney(int $amount, string $currency, int $subunit, stri
* @psalm-return non-empty-list<array{
* int,
* non-empty-string,
* positive-int|0,
* non-negative-int,
* numeric-string
* }>
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/Formatter/IntlLocalizedDecimalFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class IntlLocalizedDecimalFormatterTest extends TestCase
* @psalm-param non-empty-string $currency
* @psalm-param positive-int $subunit
* @psalm-param non-empty-string $result
* @psalm-param positive-int|0 $fractionDigits
* @psalm-param non-negative-int $fractionDigits
*
* @dataProvider moneyExamples
* @test
Expand Down Expand Up @@ -48,7 +48,7 @@ public function itFormatsMoney(int $amount, string $currency, int $subunit, stri
* positive-int,
* non-empty-string,
* int,
* positive-int|0
* non-negative-int
* }>
*/
public static function moneyExamples(): array
Expand Down
4 changes: 2 additions & 2 deletions tests/Formatter/IntlMoneyFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class IntlMoneyFormatterTest extends TestCase
* @psalm-param positive-int $subunit
* @psalm-param non-empty-string $result
* @psalm-param positive-int $mode
* @psalm-param positive-int|0 $fractionDigits
* @psalm-param non-negative-int $fractionDigits
*
* @dataProvider moneyExamples
* @test
Expand Down Expand Up @@ -54,7 +54,7 @@ public function itFormatsMoney(int $amount, string $currency, int $subunit, stri
* non-empty-string,
* positive-int,
* bool,
* positive-int|0
* non-negative-int
* }>
*/
public static function moneyExamples(): array
Expand Down
12 changes: 6 additions & 6 deletions tests/MoneyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function it_divides_the_amount(int|string $divisor, int $roundingMode, st

/**
* @psalm-param int $amount
* @psalm-param non-empty-array<positive-int|0|float> $ratios
* @psalm-param non-empty-array<non-negative-int|float> $ratios
* @psalm-param non-empty-array<int> $results
*
* @dataProvider allocationExamples
Expand Down Expand Up @@ -206,7 +206,7 @@ public function itHasComparators(int|string $amount, bool $isZero, bool $isPosit

/**
* @psalm-param int|numeric-string $amount
* @psalm-param positive-int|0 $result
* @psalm-param non-negative-int $result
*
* @dataProvider absoluteExamples
* @test
Expand Down Expand Up @@ -403,7 +403,7 @@ public function itCalculatesAvg(array $values, Money $avg): void

/**
* @psalm-param int $amount
* @psalm-param positive-int|0 $unit
* @psalm-param non-negative-int $unit
* @psalm-param int $expected
* @psalm-param int $roundingMode
*
Expand Down Expand Up @@ -469,7 +469,7 @@ public function comparisonExamples(): array
/**
* @psalm-return non-empty-list<array{
* int,
* non-empty-array<int|string, positive-int|0|float>,
* non-empty-array<int|string, non-negative-int|float>,
* non-empty-array<int|string, int>
* }>
*/
Expand Down Expand Up @@ -536,7 +536,7 @@ public function comparatorExamples(): array
/**
* @psalm-return non-empty-list<array{
* int|numeric-string,
* positive-int|0
* non-negative-int
* }>
*/
public function absoluteExamples(): array
Expand Down Expand Up @@ -589,7 +589,7 @@ public function modExamples(): array
/**
* @psalm-return non-empty-list<array{
* int,
* positive-int|0,
* non-negative-int,
* int,
* int
* }>
Expand Down
4 changes: 2 additions & 2 deletions tests/Parser/DecimalMoneyParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class DecimalMoneyParserTest extends TestCase
{
/**
* @psalm-param non-empty-string $currency
* @psalm-param positive-int|0 $subunit
* @psalm-param non-negative-int $subunit
* @psalm-param int $result
*
* @dataProvider formattedMoneyExamples
Expand Down Expand Up @@ -58,7 +58,7 @@ public function itThrowsAnExceptionUponInvalidInputs($input): void
* @psalm-return non-empty-list<array{
* string,
* non-empty-string,
* positive-int|0,
* non-negative-int,
* int
* }>
*/
Expand Down

0 comments on commit 44c23c7

Please sign in to comment.