From cea5ff8ef5acc86697c63ef80553679ae5c3a36a Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Mon, 2 Oct 2023 07:55:30 +0200 Subject: [PATCH 1/8] Support PHP 8.3 --- .github/workflows/checks.yml | 2 +- .github/workflows/ci.yml | 9 +++++---- .github/workflows/static.yml | 2 +- composer.json | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f9d6b7bb..1c721fd9 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install uses: docker://composer diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c5900f4..2a64fe92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up locales run: ./hack/setup-locales.sh @@ -40,6 +40,7 @@ jobs: - '8.0' - '8.1' - '8.2' + - '8.3' steps: - name: Set up PHP @@ -53,7 +54,7 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up locales run: ./hack/setup-locales.sh @@ -70,7 +71,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up PHP uses: shivammathur/setup-php@v2 @@ -95,7 +96,7 @@ jobs: architecture: 'x64' - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install dependencies run: | diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index df23ac24..4e3bfafa 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up PHP uses: shivammathur/setup-php@v2 diff --git a/composer.json b/composer.json index da73d311..788cecb2 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ ], "homepage": "http://moneyphp.org", "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", "ext-bcmath": "*", "ext-filter": "*", "ext-json": "*" From a6394eab1073bdeda5a37e689a5c53ca5aadc0c5 Mon Sep 17 00:00:00 2001 From: Frederik Bosch Date: Fri, 17 Nov 2023 13:31:12 +0100 Subject: [PATCH 2/8] upgrade psalm to 5.15 and above --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 788cecb2..bb135593 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "phpunit/phpunit": "^9.5.4", "psalm/plugin-phpunit": "^0.18.4", "psr/cache": "^1.0.1", - "vimeo/psalm": "~5.3.0" + "vimeo/psalm": "~5.15.0" }, "suggest": { "ext-gmp": "Calculate without integer limits", From 0544b71e2d956ebb602ecb174f5e0f72bd292b8a Mon Sep 17 00:00:00 2001 From: Frederik Bosch Date: Fri, 17 Nov 2023 13:41:29 +0100 Subject: [PATCH 3/8] upgrade psalm to 5.15 --- src/Calculator/BcMathCalculator.php | 2 +- src/Currencies/CryptoCurrencies.php | 2 -- src/Currencies/ISOCurrencies.php | 2 -- tests/NumberTest.php | 2 ++ 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Calculator/BcMathCalculator.php b/src/Calculator/BcMathCalculator.php index 087b3c05..123af44c 100644 --- a/src/Calculator/BcMathCalculator.php +++ b/src/Calculator/BcMathCalculator.php @@ -226,6 +226,6 @@ public static function mod(string $amount, string $divisor): string throw InvalidArgumentException::moduloByZero(); } - return bcmod($amount, $divisor) ?? '0'; + return bcmod($amount, $divisor); } } diff --git a/src/Currencies/CryptoCurrencies.php b/src/Currencies/CryptoCurrencies.php index b1a400c8..bce86b9b 100644 --- a/src/Currencies/CryptoCurrencies.php +++ b/src/Currencies/CryptoCurrencies.php @@ -82,14 +82,12 @@ private function getCurrencies(): array * minorUnit: positive-int|0 * }> * - * @psalm-suppress MoreSpecificReturnType do not specify all keys and values */ private function loadCurrencies(): array { $file = __DIR__ . '/../../resources/binance.php'; if (is_file($file)) { - /** @psalm-suppress LessSpecificReturnStatement */ return require $file; } diff --git a/src/Currencies/ISOCurrencies.php b/src/Currencies/ISOCurrencies.php index 415a14ca..177f09dd 100644 --- a/src/Currencies/ISOCurrencies.php +++ b/src/Currencies/ISOCurrencies.php @@ -102,14 +102,12 @@ private function getCurrencies(): array * numericCode: positive-int * }> * - * @psalm-suppress MoreSpecificReturnType do not specify all keys and values */ private function loadCurrencies(): array { $file = __DIR__ . '/../../resources/currency.php'; if (is_file($file)) { - /** @psalm-suppress LessSpecificReturnStatement */ return require $file; } diff --git a/tests/NumberTest.php b/tests/NumberTest.php index 20104f9d..08e5aa47 100644 --- a/tests/NumberTest.php +++ b/tests/NumberTest.php @@ -97,6 +97,8 @@ public function itCreatesANumberFromAFloatingPointValue(): void * }> * * @psalm-suppress InvalidOperand + * @psalm-suppress LessSpecificReturnStatement + * @psalm-suppress MoreSpecificReturnType * * the {@see PHP_INT_MAX} operations below cannot be inferred to numeric-string * the {@see PHP_INT_MAX} operations below cannot be inferred to numeric-string From 9ad8605b964e280cd8855daa81bd84638947c4b8 Mon Sep 17 00:00:00 2001 From: Frederik Bosch Date: Fri, 17 Nov 2023 13:43:20 +0100 Subject: [PATCH 4/8] phpcs --- src/Currencies/CryptoCurrencies.php | 1 - src/Currencies/ISOCurrencies.php | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Currencies/CryptoCurrencies.php b/src/Currencies/CryptoCurrencies.php index bce86b9b..e57911ed 100644 --- a/src/Currencies/CryptoCurrencies.php +++ b/src/Currencies/CryptoCurrencies.php @@ -81,7 +81,6 @@ private function getCurrencies(): array * symbol: non-empty-string, * minorUnit: positive-int|0 * }> - * */ private function loadCurrencies(): array { diff --git a/src/Currencies/ISOCurrencies.php b/src/Currencies/ISOCurrencies.php index 177f09dd..f2890b31 100644 --- a/src/Currencies/ISOCurrencies.php +++ b/src/Currencies/ISOCurrencies.php @@ -101,7 +101,6 @@ private function getCurrencies(): array * minorUnit: positive-int|0, * numericCode: positive-int * }> - * */ private function loadCurrencies(): array { From 7979669ef77e1de9587ca8867f6d54cedd4bddcc Mon Sep 17 00:00:00 2001 From: Frederik Bosch Date: Mon, 20 Nov 2023 17:07:58 +0100 Subject: [PATCH 5/8] increase test coverage --- tests/Currencies/CachedCurrenciesTest.php | 67 +++++++++++++++++++ tests/CurrencyPairTest.php | 78 +++++++++++++---------- tests/CurrencyTest.php | 17 +++++ tests/Exchange/FixedExchangeTest.php | 33 ++++++++++ tests/MoneyTest.php | 20 ++++++ 5 files changed, 181 insertions(+), 34 deletions(-) create mode 100644 tests/Exchange/FixedExchangeTest.php diff --git a/tests/Currencies/CachedCurrenciesTest.php b/tests/Currencies/CachedCurrenciesTest.php index 38ce1de7..0993e817 100644 --- a/tests/Currencies/CachedCurrenciesTest.php +++ b/tests/Currencies/CachedCurrenciesTest.php @@ -122,4 +122,71 @@ public function it_is_iterable(): void iterator_to_array(new CachedCurrencies($wrappedCurrencies, $cache)) ); } + + /** @test */ + public function it_checks_subunits_from_the_cache(): void + { + $currency = new Currency('EUR'); + + $hit = $this->createMock(CacheItemInterface::class); + $cache = $this->createMock(CacheItemPoolInterface::class); + $wrappedCurrencies = $this->createMock(Currencies::class); + + $hit->method('isHit') + ->willReturn(true); + $hit->expects(self::never()) + ->method('set'); + $hit->method('get') + ->willReturn(2); + + $cache->method('getItem') + ->with('currency|subunit|EUR') + ->willReturn($hit); + $cache->expects(self::never()) + ->method('save'); + + $wrappedCurrencies->expects(self::never()) + ->method('subunitFor'); + + self::assertEquals( + 2, + (new CachedCurrencies($wrappedCurrencies, $cache)) + ->subunitFor($currency) + ); + } + + /** @test */ + public function it_saves_subunits_to_the_cache(): void + { + $currency = new Currency('EUR'); + + $hit = $this->createMock(CacheItemInterface::class); + $cache = $this->createMock(CacheItemPoolInterface::class); + $wrappedCurrencies = $this->createMock(Currencies::class); + + $hit->method('isHit') + ->willReturn(false); + $hit->expects(self::once()) + ->method('set') + ->with(2); + $hit->expects(self::once()) + ->method('get') + ->willReturn(2); + + $cache->method('getItem') + ->with('currency|subunit|EUR') + ->willReturn($hit); + $cache->expects(self::once()) + ->method('save'); + + $wrappedCurrencies->expects(self::once()) + ->method('subunitFor') + ->willReturn(2); + + self::assertEquals( + 2, + (new CachedCurrencies($wrappedCurrencies, $cache)) + ->subunitFor($currency) + ); + } } diff --git a/tests/CurrencyPairTest.php b/tests/CurrencyPairTest.php index bba68ce9..7ccdfebe 100644 --- a/tests/CurrencyPairTest.php +++ b/tests/CurrencyPairTest.php @@ -16,54 +16,64 @@ final class CurrencyPairTest extends TestCase /** * @test */ - public function itConvertsToJson(): void - { - $expectedJson = '{"baseCurrency":"EUR","counterCurrency":"USD","ratio":"1.25"}'; - $actualJson = json_encode(new CurrencyPair(new Currency('EUR'), new Currency('USD'), '1.25')); - - self::assertEquals($expectedJson, $actualJson); - } - - /** @test */ - public function it_parses_an_iso_string(): void + public function itProvidesGetters(): void { - self::assertEquals( - new CurrencyPair(new Currency('EUR'), new Currency('USD'), '1.250000'), - CurrencyPair::createFromIso('EUR/USD 1.250000') + $pair = new CurrencyPair( + new Currency('USD'), + new Currency('EUR'), + '1.0' ); + + self::assertEquals('USD', $pair->getBaseCurrency()->getCode()); + self::assertEquals('EUR', $pair->getCounterCurrency()->getCode()); + self::assertEquals('1.0', $pair->getConversionRatio()); } - /** @test */ - public function it_equals_to_another_currency_pair(): void + /** + * @test + */ + public function itProvidesEquality(): void { - $pair = new CurrencyPair( - new Currency('EUR'), + $pair1 = new CurrencyPair( new Currency('USD'), - '1.250000' + new Currency('EUR'), + '1.0' ); - self::assertFalse($pair->equals(new CurrencyPair( - new Currency('GBP'), + self::assertTrue($pair1->equals(new CurrencyPair( new Currency('USD'), - '1.250000' - ))); - - self::assertFalse($pair->equals(new CurrencyPair( new Currency('EUR'), - new Currency('GBP'), - '1.250000' + '1.0' ))); - - self::assertFalse($pair->equals(new CurrencyPair( - new Currency('EUR'), + self::assertFalse($pair1->equals(new CurrencyPair( new Currency('USD'), - '1.5000' + new Currency('EUR'), + '2.0' ))); + } - self::assertTrue($pair->equals(new CurrencyPair( - new Currency('EUR'), + /** + * @test + */ + public function itConvertsToJson(): void + { + $pair = new CurrencyPair( new Currency('USD'), - '1.250000' - ))); + new Currency('EUR'), + '1.0' + ); + + self::assertEquals('{"baseCurrency":"USD","counterCurrency":"EUR","ratio":"1.0"}', json_encode($pair)); + } + + /** + * @test + */ + public function itCanBeCreatedWithAnIsoString(): void + { + $pair = CurrencyPair::createFromIso('EUR/USD 1.2500'); + self::assertEquals('EUR', $pair->getBaseCurrency()->getCode()); + self::assertEquals('USD', $pair->getCounterCurrency()->getCode()); + self::assertEquals('1.2500', $pair->getConversionRatio()); } } diff --git a/tests/CurrencyTest.php b/tests/CurrencyTest.php index 8a07a018..2500991a 100644 --- a/tests/CurrencyTest.php +++ b/tests/CurrencyTest.php @@ -27,4 +27,21 @@ public function itAppliesUppercase(): void { self::assertEquals('USD', (new Currency('usd'))->getCode()); } + + /** + * @test + */ + public function itIsStringable(): void + { + self::assertEquals('USD', (string) new Currency('usd')); + } + + /** + * @test + */ + public function itProvidesEqualityComparison(): void + { + $currency = new Currency('usd'); + self::assertTrue($currency->equals(new Currency('USD'))); + } } diff --git a/tests/Exchange/FixedExchangeTest.php b/tests/Exchange/FixedExchangeTest.php new file mode 100644 index 00000000..b26891a6 --- /dev/null +++ b/tests/Exchange/FixedExchangeTest.php @@ -0,0 +1,33 @@ + ['USD' => '1.2500']]); + $currencyPair = $exchange->quote(new Currency('EUR'), new Currency('USD')); + + self::assertEquals('EUR', $currencyPair->getBaseCurrency()); + self::assertEquals('USD', $currencyPair->getCounterCurrency()); + self::assertEquals('1.2500', $currencyPair->getConversionRatio()); + } + + /** @test */ + public function it_throws_when_quoting_unknown_currency(): void + { + $this->expectException(UnresolvableCurrencyPairException::class); + $exchange = new FixedExchange(['EUR' => ['USD' => '1.2500']]); + $exchange->quote(new Currency('EUR'), new Currency('SOME')); + } +} diff --git a/tests/MoneyTest.php b/tests/MoneyTest.php index 1aa23d35..5c20ab94 100644 --- a/tests/MoneyTest.php +++ b/tests/MoneyTest.php @@ -400,6 +400,26 @@ public function itRoundsToUnit($amount, $unit, $expected, $roundingMode): void self::assertEquals(Money::EUR($expected), Money::EUR($amount)->roundToUnit($unit, $roundingMode)); } + /** @test */ + public function itThrowsWithDecimal(): void + { + $this->expectException(InvalidArgumentException::class); + new Money('5.1', new Currency(self::CURRENCY)); + } + + /** + * @test + */ + public function itThrowsWhenComparingDifferentCurrencies(): void + { + $money = new Money('5', new Currency(self::CURRENCY)); + + $this->expectException(InvalidArgumentException::class); + + /** @psalm-suppress UnusedMethodCall */ + $money->compare(new Money('5', new Currency('SOME'))); + } + /** * @psalm-return non-empty-list Date: Tue, 21 Nov 2023 09:41:01 +0100 Subject: [PATCH 6/8] remove phpspec --- .gitattributes | 2 - .gitignore | 1 - README.md | 2 +- composer.json | 3 - phpspec.yml.dist | 5 - spec/Calculator/BcMathCalculatorSpec.php | 18 --- spec/Calculator/CalculatorBehavior.php | 92 ----------- spec/Calculator/GmpCalculatorSpec.php | 18 --- spec/ConverterSpec.php | 74 --------- spec/Currencies/BitcoinCurrenciesSpec.php | 36 ----- spec/Currencies/CurrencyListSpec.php | 49 ------ spec/Currencies/ISOCurrenciesSpec.php | 24 --- spec/Currencies/Matchers.php | 32 ---- spec/CurrencyPairSpec.php | 51 ------- spec/CurrencySpec.php | 38 ----- spec/Exception/FormatterExceptionSpec.php | 28 ---- spec/Exception/ParserExceptionSpec.php | 28 ---- .../UnknownCurrencyExceptionSpec.php | 28 ---- .../UnresolvableCurrencyPairExceptionSpec.php | 35 ----- spec/Exchange/FixedExchangeSpec.php | 51 ------- spec/Formatter/BitcoinMoneyFormatterSpec.php | 53 ------- spec/Formatter/DecimalMoneyFormatterSpec.php | 39 ----- spec/Formatter/IntlMoneyFormatterSpec.php | 41 ----- spec/MoneySpec.php | 144 ------------------ spec/NumberSpec.php | 38 ----- spec/Parser/BitcoinMoneyParserSpec.php | 48 ------ spec/Parser/DecimalMoneyParserSpec.php | 58 ------- spec/Parser/IntlMoneyParserSpec.php | 60 -------- 28 files changed, 1 insertion(+), 1095 deletions(-) delete mode 100644 phpspec.yml.dist delete mode 100644 spec/Calculator/BcMathCalculatorSpec.php delete mode 100644 spec/Calculator/CalculatorBehavior.php delete mode 100644 spec/Calculator/GmpCalculatorSpec.php delete mode 100644 spec/ConverterSpec.php delete mode 100644 spec/Currencies/BitcoinCurrenciesSpec.php delete mode 100644 spec/Currencies/CurrencyListSpec.php delete mode 100644 spec/Currencies/ISOCurrenciesSpec.php delete mode 100644 spec/Currencies/Matchers.php delete mode 100644 spec/CurrencyPairSpec.php delete mode 100644 spec/CurrencySpec.php delete mode 100644 spec/Exception/FormatterExceptionSpec.php delete mode 100644 spec/Exception/ParserExceptionSpec.php delete mode 100644 spec/Exception/UnknownCurrencyExceptionSpec.php delete mode 100644 spec/Exception/UnresolvableCurrencyPairExceptionSpec.php delete mode 100644 spec/Exchange/FixedExchangeSpec.php delete mode 100644 spec/Formatter/BitcoinMoneyFormatterSpec.php delete mode 100644 spec/Formatter/DecimalMoneyFormatterSpec.php delete mode 100644 spec/Formatter/IntlMoneyFormatterSpec.php delete mode 100644 spec/MoneySpec.php delete mode 100644 spec/NumberSpec.php delete mode 100644 spec/Parser/BitcoinMoneyParserSpec.php delete mode 100644 spec/Parser/DecimalMoneyParserSpec.php delete mode 100644 spec/Parser/IntlMoneyParserSpec.php diff --git a/.gitattributes b/.gitattributes index 3e9ca7c3..3d046086 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,12 +8,10 @@ Dockerfile export-ignore /benchmark/ export-ignore /hack/ export-ignore /phpbench.json export-ignore -/phpspec.yml.dist export-ignore /phpstan-baseline.neon export-ignore /phpstan.neon.dist export-ignore /phpunit.xml.dist export-ignore /psalm.xml export-ignore -/spec/ export-ignore /tests/ export-ignore /doc/ export-ignore diff --git a/.gitignore b/.gitignore index 42674bbe..7d448349 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ .php_cs.cache .phpunit.result.cache /build/ -/phpspec.yml /phpunit.xml /vendor/ diff --git a/README.md b/README.md index 4e2ebb5c..c782769a 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Please see the [official documentation](http://moneyphp.org). ## Testing -We try to follow BDD and TDD, as such we use both [phpspec](http://www.phpspec.net) and [phpunit](https://phpunit.de) to test this library. +We try to follow TDD by using [phpunit](https://phpunit.de) to test this library. ```bash $ composer test diff --git a/composer.json b/composer.json index bb135593..7ce16545 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,6 @@ "php-http/message": "^1.11.0", "php-http/mock-client": "^1.4.1", "phpbench/phpbench": "^1.2.5", - "phpspec/phpspec": "^7.3", "phpunit/phpunit": "^9.5.4", "psalm/plugin-phpunit": "^0.18.4", "psr/cache": "^1.0.1", @@ -66,7 +65,6 @@ "psr-4": { "Benchmark\\Money\\": "benchmark/", "Tests\\Money\\": "tests/", - "spec\\Money\\": "spec/" } }, "config": { @@ -90,7 +88,6 @@ ], "clean": "rm -rf build/ vendor/", "test": [ - "vendor/bin/phpspec run", "vendor/bin/phpunit -v", "vendor/bin/phpbench run", "vendor/bin/psalm", diff --git a/phpspec.yml.dist b/phpspec.yml.dist deleted file mode 100644 index 069500c3..00000000 --- a/phpspec.yml.dist +++ /dev/null @@ -1,5 +0,0 @@ -suites: - money_suite: - namespace: Money - psr4_prefix: Money -formatter.name: pretty diff --git a/spec/Calculator/BcMathCalculatorSpec.php b/spec/Calculator/BcMathCalculatorSpec.php deleted file mode 100644 index adb16ddc..00000000 --- a/spec/Calculator/BcMathCalculatorSpec.php +++ /dev/null @@ -1,18 +0,0 @@ -shouldHaveType(BcMathCalculator::class); - } -} diff --git a/spec/Calculator/CalculatorBehavior.php b/spec/Calculator/CalculatorBehavior.php deleted file mode 100644 index e19df648..00000000 --- a/spec/Calculator/CalculatorBehavior.php +++ /dev/null @@ -1,92 +0,0 @@ -shouldImplement(Calculator::class); - } - - public function it_compares_two_values(): void - { - $this->compare(2, 1)->shouldReturn(1); - $this->compare(1, 2)->shouldReturn(-1); - $this->compare(1, 1)->shouldReturn(0); - } - - public function it_adds_two_values(): void - { - $this->add(rand(-100, 100), rand(-100, 100))->shouldBeString(); - } - - public function it_subtracts_a_value_from_another(): void - { - $this->subtract(rand(-100, 100), rand(-100, 100))->shouldBeString(); - } - - public function it_multiplies_a_value_by_another(): void - { - $this->multiply(rand(-100, 100), rand(-100, 100))->shouldBeString(); - } - - public function it_divides_a_value_by_another(): void - { - $this->divide(rand(-100, 100), rand(1, 100))->shouldBeString(); - } - - public function it_ceils_a_value(): void - { - $this->ceil(rand(-100, 100) / 100)->shouldBeString(); - } - - public function it_floors_a_value(): void - { - $this->floor(rand(-100, 100) / 100)->shouldBeString(); - } - - public function it_calculates_the_absolute_value(): void - { - $result = $this->absolute(rand(1, 100)); - - $result->shouldBeGreaterThanZero(); - $result->shouldBeString(); - - $result = $this->absolute(rand(-100, -1)); - - $result->shouldBeGreaterThanZero(); - $result->shouldBeString(); - } - - public function it_shares_a_value(): void - { - $this->share('10', '2', '4')->shouldBeString(); - } - - public function it_calculates_the_modulus(): void - { - $this->mod('11', '5')->shouldBeString(); - } - - /** {@inheritDoc} */ - public function getMatchers(): array - { - return [ - 'beGreaterThanZero' => static function ($subject) { - return $subject > 0; - }, - ]; - } -} diff --git a/spec/Calculator/GmpCalculatorSpec.php b/spec/Calculator/GmpCalculatorSpec.php deleted file mode 100644 index c17a846f..00000000 --- a/spec/Calculator/GmpCalculatorSpec.php +++ /dev/null @@ -1,18 +0,0 @@ -shouldHaveType(GmpCalculator::class); - } -} diff --git a/spec/ConverterSpec.php b/spec/ConverterSpec.php deleted file mode 100644 index d674f26c..00000000 --- a/spec/ConverterSpec.php +++ /dev/null @@ -1,74 +0,0 @@ -beConstructedWith($currencies, $exchange); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(Converter::class); - } - - public function it_converts_to_a_different_currency(Currencies $currencies, Exchange $exchange): void - { - $baseCurrency = new Currency($baseCurrencyCode = 'ABC'); - $counterCurrency = new Currency($counterCurrencyCode = 'XYZ'); - $pair = new CurrencyPair($baseCurrency, $counterCurrency, '0.5'); - - $currencies->subunitFor($baseCurrency)->willReturn(100); - $currencies->subunitFor($counterCurrency)->willReturn(100); - - $exchange->quote($baseCurrency, $counterCurrency)->willReturn($pair); - - $money = $this->convert( - new Money(2, new Currency($baseCurrencyCode)), - $counterCurrency - ); - - $money->shouldHaveType(Money::class); - $money->getAmount()->shouldBe('1'); - $money->getCurrency()->getCode()->shouldBe($counterCurrencyCode); - } - - public function it_converts_using_rounding_modes(Currencies $currencies, Exchange $exchange): void - { - $baseCurrency = new Currency('EUR'); - $counterCurrency = new Currency('USD'); - $pair = new CurrencyPair($baseCurrency, $counterCurrency, '1.25'); - - $currencies->subunitFor($baseCurrency)->willReturn(2); - $currencies->subunitFor($counterCurrency)->willReturn(2); - $exchange->quote($baseCurrency, $counterCurrency)->willReturn($pair); - - $money = new Money(10, $baseCurrency); - - $resultMoney = $this->convert($money, $counterCurrency); - - $resultMoney->shouldHaveType(Money::class); - $resultMoney->getAmount()->shouldBeLike(13); - $resultMoney->getCurrency()->getCode()->shouldReturn('USD'); - - $resultMoney = $this->convert($money, $counterCurrency, PHP_ROUND_HALF_DOWN); - - $resultMoney->shouldHaveType(Money::class); - $resultMoney->getAmount()->shouldBeLike(12); - $resultMoney->getCurrency()->getCode()->shouldReturn('USD'); - } -} diff --git a/spec/Currencies/BitcoinCurrenciesSpec.php b/spec/Currencies/BitcoinCurrenciesSpec.php deleted file mode 100644 index 85aed918..00000000 --- a/spec/Currencies/BitcoinCurrenciesSpec.php +++ /dev/null @@ -1,36 +0,0 @@ -shouldHaveType(BitcoinCurrencies::class); - } - - public function it_is_a_currency_repository(): void - { - $this->shouldImplement(Currencies::class); - } - - public function it_contains_bitcoin(): void - { - $this->contains(new Currency('XBT'))->shouldReturn(true); - $this->contains(new Currency('EUR'))->shouldReturn(false); - } - - public function it_is_iterable(): void - { - $this->getIterator()->shouldHaveCurrency('XBT'); - } -} diff --git a/spec/Currencies/CurrencyListSpec.php b/spec/Currencies/CurrencyListSpec.php deleted file mode 100644 index 1bc814ac..00000000 --- a/spec/Currencies/CurrencyListSpec.php +++ /dev/null @@ -1,49 +0,0 @@ -beConstructedWith([ - 'MY1' => 2, - 'MY2' => 0, - 'MY3' => 1, - ]); - } - - public function it_is_a_currency_repository(): void - { - $this->shouldImplement(Currencies::class); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(CurrencyList::class); - } - - public function it_contains_custom_currency(): void - { - $this->contains(new Currency('MY1'))->shouldReturn(true); - } - - public function it_does_not_contain_currency(): void - { - $this->contains(new Currency('EUR'))->shouldReturn(false); - } - - public function it_is_iterable(): void - { - $this->getIterator()->shouldHaveCurrency('MY1'); - } -} diff --git a/spec/Currencies/ISOCurrenciesSpec.php b/spec/Currencies/ISOCurrenciesSpec.php deleted file mode 100644 index 331af863..00000000 --- a/spec/Currencies/ISOCurrenciesSpec.php +++ /dev/null @@ -1,24 +0,0 @@ -shouldHaveType(ISOCurrencies::class); - } - - public function it_is_a_currency_repository(): void - { - $this->shouldImplement(Currencies::class); - } -} diff --git a/spec/Currencies/Matchers.php b/spec/Currencies/Matchers.php deleted file mode 100644 index 6acb9c84..00000000 --- a/spec/Currencies/Matchers.php +++ /dev/null @@ -1,32 +0,0 @@ - */ - public function getMatchers(): array - { - return [ - 'haveCurrency' => static function (mixed $subject, mixed $value): bool { - assert(is_iterable($subject)); - - foreach ($subject as $currency) { - assert($currency instanceof Currency); - if ($currency->getCode() === $value) { - return true; - } - } - - return false; - }, - ]; - } -} diff --git a/spec/CurrencyPairSpec.php b/spec/CurrencyPairSpec.php deleted file mode 100644 index ae33466f..00000000 --- a/spec/CurrencyPairSpec.php +++ /dev/null @@ -1,51 +0,0 @@ -beConstructedWith(new Currency('EUR'), new Currency('USD'), '1.250000'); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(CurrencyPair::class); - } - - public function it_is_json_serializable(): void - { - $this->shouldImplement(JsonSerializable::class); - } - - public function it_has_currencies_and_ratio(): void - { - $this->beConstructedWith($base = new Currency('EUR'), $counter = new Currency('USD'), $ratio = '1.0'); - - $this->getBaseCurrency()->shouldReturn($base); - $this->getCounterCurrency()->shouldReturn($counter); - $this->getConversionRatio()->shouldReturn($ratio); - } - - public function it_equals_to_another_currency_pair(): void - { - $this->equals(new CurrencyPair(new Currency('GBP'), new Currency('USD'), '1.250000'))->shouldReturn(false); - $this->equals(new CurrencyPair(new Currency('EUR'), new Currency('GBP'), '1.250000'))->shouldReturn(false); - $this->equals(new CurrencyPair(new Currency('EUR'), new Currency('USD'), '1.5000'))->shouldReturn(false); - $this->equals(new CurrencyPair(new Currency('EUR'), new Currency('USD'), '1.250000'))->shouldReturn(true); - } - - public function it_throws_an_exception_when_iso_string_cannot_be_parsed(): void - { - $this->shouldThrow(InvalidArgumentException::class)->duringCreateFromIso('1.250000'); - } -} diff --git a/spec/CurrencySpec.php b/spec/CurrencySpec.php deleted file mode 100644 index b492b26f..00000000 --- a/spec/CurrencySpec.php +++ /dev/null @@ -1,38 +0,0 @@ -beConstructedWith('EUR'); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(Currency::class); - } - - public function it_is_json_serializable(): void - { - $this->shouldImplement(JsonSerializable::class); - } - - public function it_has_a_code(): void - { - $this->getCode()->shouldReturn('EUR'); - } - - public function it_equals_to_a_currency_with_the_same_code(): void - { - $this->equals(new Currency('EUR'))->shouldReturn(true); - $this->equals(new Currency('USD'))->shouldReturn(false); - } -} diff --git a/spec/Exception/FormatterExceptionSpec.php b/spec/Exception/FormatterExceptionSpec.php deleted file mode 100644 index b105b339..00000000 --- a/spec/Exception/FormatterExceptionSpec.php +++ /dev/null @@ -1,28 +0,0 @@ -shouldHaveType(FormatterException::class); - } - - public function it_is_an_exception(): void - { - $this->shouldHaveType(Exception::class); - } - - public function it_is_a_runtime_exception(): void - { - $this->shouldHaveType(RuntimeException::class); - } -} diff --git a/spec/Exception/ParserExceptionSpec.php b/spec/Exception/ParserExceptionSpec.php deleted file mode 100644 index b4d7aab5..00000000 --- a/spec/Exception/ParserExceptionSpec.php +++ /dev/null @@ -1,28 +0,0 @@ -shouldHaveType(ParserException::class); - } - - public function it_is_an_exception(): void - { - $this->shouldHaveType(Exception::class); - } - - public function it_is_a_runtime_exception(): void - { - $this->shouldHaveType(RuntimeException::class); - } -} diff --git a/spec/Exception/UnknownCurrencyExceptionSpec.php b/spec/Exception/UnknownCurrencyExceptionSpec.php deleted file mode 100644 index 9170d40e..00000000 --- a/spec/Exception/UnknownCurrencyExceptionSpec.php +++ /dev/null @@ -1,28 +0,0 @@ -shouldHaveType(UnknownCurrencyException::class); - } - - public function it_is_an_exception(): void - { - $this->shouldHaveType(Exception::class); - } - - public function it_is_a_domain_exception(): void - { - $this->shouldHaveType(DomainException::class); - } -} diff --git a/spec/Exception/UnresolvableCurrencyPairExceptionSpec.php b/spec/Exception/UnresolvableCurrencyPairExceptionSpec.php deleted file mode 100644 index a559bee4..00000000 --- a/spec/Exception/UnresolvableCurrencyPairExceptionSpec.php +++ /dev/null @@ -1,35 +0,0 @@ -shouldHaveType(UnresolvableCurrencyPairException::class); - } - - public function it_is_an_exception(): void - { - $this->shouldHaveType(Exception::class); - } - - public function it_is_an_invalid_argument_exception(): void - { - $this->shouldHaveType(InvalidArgumentException::class); - } - - public function it_accepts_a_currency_pair(): void - { - $this->createFromCurrencies(new Currency('EUR'), new Currency('USD')) - ->shouldHaveType(UnresolvableCurrencyPairException::class); - } -} diff --git a/spec/Exchange/FixedExchangeSpec.php b/spec/Exchange/FixedExchangeSpec.php deleted file mode 100644 index d4c82ac2..00000000 --- a/spec/Exchange/FixedExchangeSpec.php +++ /dev/null @@ -1,51 +0,0 @@ -beConstructedWith([ - 'EUR' => ['USD' => '1.25'], - ]); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(FixedExchange::class); - } - - public function it_is_an_exchange(): void - { - $this->shouldImplement(Exchange::class); - } - - public function it_exchanges_currencies(): void - { - $baseCurrency = new Currency('EUR'); - $counterCurrency = new Currency('USD'); - - $currencyPair = $this->quote($baseCurrency, $counterCurrency); - - $currencyPair->shouldHaveType(CurrencyPair::class); - $currencyPair->getBaseCurrency()->shouldReturn($baseCurrency); - $currencyPair->getCounterCurrency()->shouldReturn($counterCurrency); - $currencyPair->getConversionRatio()->shouldReturn('1.25'); - } - - public function it_cannot_exchange_currencies(): void - { - $this->shouldThrow(UnresolvableCurrencyPairException::class) - ->duringQuote(new Currency('USD'), new Currency('EUR')); - } -} diff --git a/spec/Formatter/BitcoinMoneyFormatterSpec.php b/spec/Formatter/BitcoinMoneyFormatterSpec.php deleted file mode 100644 index 46337387..00000000 --- a/spec/Formatter/BitcoinMoneyFormatterSpec.php +++ /dev/null @@ -1,53 +0,0 @@ -beConstructedWith(2, $bitcoinCurrencies); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(BitcoinMoneyFormatter::class); - } - - public function it_is_a_money_formatter(): void - { - $this->shouldImplement(MoneyFormatter::class); - } - - public function it_formats_money(Currencies $bitcoinCurrencies): void - { - $this->beConstructedWith(1, $bitcoinCurrencies); - - $currency = new Currency('XBT'); - $money = new Money(1000000, $currency); - - $bitcoinCurrencies->subunitFor($currency)->willReturn(8); - - $formatted = $this->format($money); - - $formatted->shouldBeString(); - $formatted->shouldContain(Currencies\BitcoinCurrencies::SYMBOL); - } - - public function it_throws_an_exception_when_currency_is_not_bitcoin(): void - { - $money = new Money(5, new Currency('USD')); - - $this->shouldThrow(FormatterException::class)->duringFormat($money); - } -} diff --git a/spec/Formatter/DecimalMoneyFormatterSpec.php b/spec/Formatter/DecimalMoneyFormatterSpec.php deleted file mode 100644 index c42fe23b..00000000 --- a/spec/Formatter/DecimalMoneyFormatterSpec.php +++ /dev/null @@ -1,39 +0,0 @@ -beConstructedWith($currencies); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(DecimalMoneyFormatter::class); - } - - public function it_is_a_money_formatter(): void - { - $this->shouldImplement(MoneyFormatter::class); - } - - public function it_formats_money(Currencies $currencies): void - { - $money = new Money(100, new Currency('EUR')); - - $currencies->subunitFor($money->getCurrency())->willReturn(2); - - $this->format($money)->shouldReturn('1.00'); - } -} diff --git a/spec/Formatter/IntlMoneyFormatterSpec.php b/spec/Formatter/IntlMoneyFormatterSpec.php deleted file mode 100644 index 202b96bb..00000000 --- a/spec/Formatter/IntlMoneyFormatterSpec.php +++ /dev/null @@ -1,41 +0,0 @@ -beConstructedWith($numberFormatter, $currencies); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(IntlMoneyFormatter::class); - } - - public function it_is_a_money_formatter(): void - { - $this->shouldImplement(MoneyFormatter::class); - } - - public function it_formats_money(NumberFormatter $numberFormatter, Currencies $currencies): void - { - $money = new Money(1, new Currency('EUR')); - - $numberFormatter->formatCurrency('0.01', 'EUR')->willReturn('€1.00'); - $currencies->subunitFor($money->getCurrency())->willReturn(2); - - $this->format($money)->shouldReturn('€1.00'); - } -} diff --git a/spec/MoneySpec.php b/spec/MoneySpec.php deleted file mode 100644 index 9adf3da2..00000000 --- a/spec/MoneySpec.php +++ /dev/null @@ -1,144 +0,0 @@ -beConstructedWith(self::AMOUNT, new Currency(self::CURRENCY)); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(Money::class); - } - - public function it_is_json_serializable(): void - { - $this->shouldImplement(JsonSerializable::class); - } - - public function it_has_an_amount(): void - { - $this->getAmount()->shouldBeLike(self::AMOUNT); - } - - public function it_has_a_currency(): void - { - $currency = $this->getCurrency(); - - $currency->shouldHaveType(Currency::class); - $currency->equals(new Currency(self::CURRENCY))->shouldReturn(true); - } - - public function it_throws_an_exception_when_amount_is_not_numeric(): void - { - $this->beConstructedWith('ONE', new Currency(self::CURRENCY)); - - $this->shouldThrow(InvalidArgumentException::class)->duringInstantiation(); - } - - public function it_constructs_integer(): void - { - $this->beConstructedWith(5, new Currency(self::CURRENCY)); - } - - public function it_constructs_string(): void - { - $this->beConstructedWith('5', new Currency(self::CURRENCY)); - } - - public function it_constructs_integer_with_decimals_of_zero(): void - { - $this->beConstructedWith('5.00', new Currency(self::CURRENCY)); - } - - public function it_constructs_integer_with_plus(): void - { - $this->beConstructedWith('+500', new Currency(self::CURRENCY)); - - $this->shouldNotThrow(InvalidArgumentException::class)->duringInstantiation(); - } - - public function it_tests_currency_equality(): void - { - $this->isSameCurrency(new Money(self::AMOUNT, new Currency(self::CURRENCY)))->shouldReturn(true); - $this->isSameCurrency(new Money(self::AMOUNT, new Currency(self::OTHER_CURRENCY)))->shouldReturn(false); - } - - public function it_tests_currency_equality_with_multiple_arguments(): void - { - $this->isSameCurrency( - new Money(self::AMOUNT, new Currency(self::CURRENCY)), - new Money(self::AMOUNT, new Currency(self::CURRENCY)) - )->shouldReturn(true); - - $this->isSameCurrency( - new Money(self::AMOUNT, new Currency(self::CURRENCY)), - new Money(self::AMOUNT, new Currency(self::OTHER_CURRENCY)) - )->shouldReturn(false); - } - - public function it_equals_to_another_money(): void - { - $this->equals(new Money(self::AMOUNT, new Currency(self::CURRENCY)))->shouldReturn(true); - } - - public function it_returns_the_same_money_when_no_addends_are_provided(): void - { - $money = $this->add(); - - $money->getAmount()->shouldBe($this->getAmount()); - } - - public function it_returns_the_same_money_when_no_subtrahends_are_provided(): void - { - $money = $this->subtract(); - - $money->getAmount()->shouldBe($this->getAmount()); - } - - public function it_throws_an_exception_when_allocation_target_is_empty(): void - { - $this->shouldThrow(InvalidArgumentException::class)->duringAllocate([]); - } - - /** {@inheritDoc} */ - public function getMatchers(): array - { - return [ - 'equalAllocation' => function ($subject, $value) { - foreach ($subject as $key => $money) { - assert($money instanceof Money); - $compareTo = new Money($value[$key], $money->getCurrency()); - if ($money->equals($compareTo) === false) { - return false; - } - } - - return true; - }, - ]; - } -} diff --git a/spec/NumberSpec.php b/spec/NumberSpec.php deleted file mode 100644 index d2a90263..00000000 --- a/spec/NumberSpec.php +++ /dev/null @@ -1,38 +0,0 @@ -beConstructedWith('1'); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(Number::class); - } - - public function it_throws_an_exception_when_number_is_invalid(): void - { - $this->beConstructedWith('ONE'); - - $this->shouldThrow(InvalidArgumentException::class)->duringInstantiation(); - } - - public function it_creates_a_number_from_float(): void - { - $number = $this->fromFloat(1.1); - - $number->shouldHaveType(Number::class); - $number->__toString()->shouldReturn('1.1'); - } -} diff --git a/spec/Parser/BitcoinMoneyParserSpec.php b/spec/Parser/BitcoinMoneyParserSpec.php deleted file mode 100644 index 9cee0e61..00000000 --- a/spec/Parser/BitcoinMoneyParserSpec.php +++ /dev/null @@ -1,48 +0,0 @@ -beConstructedWith(2); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(BitcoinMoneyParser::class); - } - - public function it_is_a_money_parser(): void - { - $this->shouldImplement(MoneyParser::class); - } - - public function it_parses_money(): void - { - $money = $this->parse('Ƀ1000.00'); - - $money->shouldHaveType(Money::class); - $money->getCurrency()->getCode()->shouldReturn(BitcoinCurrencies::CODE); - } - - public function it_does_not_parse_a_different_currency(): void - { - $this->shouldThrow(ParserException::class)->duringParse('€1.00'); - } - - public function it_does_not_parse_an_invalid_value(): void - { - $this->shouldThrow(ParserException::class)->duringParse(true); - } -} diff --git a/spec/Parser/DecimalMoneyParserSpec.php b/spec/Parser/DecimalMoneyParserSpec.php deleted file mode 100644 index 166c8adb..00000000 --- a/spec/Parser/DecimalMoneyParserSpec.php +++ /dev/null @@ -1,58 +0,0 @@ -beConstructedWith($currencies); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(DecimalMoneyParser::class); - } - - public function it_is_a_money_parser(): void - { - $this->shouldImplement(MoneyParser::class); - } - - public function it_parses_money(Currencies $currencies): void - { - $currencies->subunitFor(Argument::type(Currency::class))->willReturn(2); - - $money = $this->parse('1.00', new Currency('EUR')); - - $money->shouldHaveType(Money::class); - $money->getAmount()->shouldReturn('100'); - $money->getCurrency()->getCode()->shouldReturn('EUR'); - } - - public function it_throws_an_exception_when_there_is_no_currency(): void - { - $this->shouldThrow(ParserException::class)->duringParse('100'); - } - - public function it_throws_an_exception_when_money_includes_currency_symbol(): void - { - $this->shouldThrow(ParserException::class)->duringParse('€ 100', new Currency('EUR')); - } - - public function it_throws_an_exception_when_money_is_not_a_valid_decimal(): void - { - $this->shouldThrow(ParserException::class)->duringParse('INVALID', new Currency('EUR')); - } -} diff --git a/spec/Parser/IntlMoneyParserSpec.php b/spec/Parser/IntlMoneyParserSpec.php deleted file mode 100644 index 1d2e60bf..00000000 --- a/spec/Parser/IntlMoneyParserSpec.php +++ /dev/null @@ -1,60 +0,0 @@ -beConstructedWith($numberFormatter, $currencies); - } - - public function it_is_initializable(): void - { - $this->shouldHaveType(IntlMoneyParser::class); - } - - public function it_is_a_money_parser(): void - { - $this->shouldImplement(MoneyParser::class); - } - - public function it_parses_money(NumberFormatter $numberFormatter, Currencies $currencies): void - { - $currencyString = ''; - - $numberFormatter->parseCurrency('€1.00', $currencyString)->willReturn(1); - $currencies->subunitFor(Argument::type(Currency::class))->willReturn(2); - - $currency = new Currency('EUR'); - $money = $this->parse('€1.00', $currency); - - $money->shouldHaveType(Money::class); - $money->getAmount()->shouldReturn('100'); - $money->getCurrency()->getCode()->shouldReturn('EUR'); - } - - public function it_throws_an_exception_when_money_cannot_be_parsed(NumberFormatter $numberFormatter): void - { - $currencyString = ''; - - $numberFormatter->parseCurrency('INVALID', $currencyString)->willReturn(false); - $numberFormatter->getErrorMessage()->willReturn('Some message'); - - $currency = new Currency('EUR'); - - $this->shouldThrow(ParserException::class)->duringParse('INVALID', $currency); - } -} From 6b7a9ae95d50df584515a9882c6d9dd3802ab9eb Mon Sep 17 00:00:00 2001 From: Frederik Bosch Date: Tue, 21 Nov 2023 09:41:50 +0100 Subject: [PATCH 7/8] remove phpspec --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7ce16545..9a8f10c4 100644 --- a/composer.json +++ b/composer.json @@ -64,7 +64,7 @@ "autoload-dev": { "psr-4": { "Benchmark\\Money\\": "benchmark/", - "Tests\\Money\\": "tests/", + "Tests\\Money\\": "tests/" } }, "config": { From 82522df7bab1a058cbed7c46fd4713ce162d3d9c Mon Sep 17 00:00:00 2001 From: Frederik Bosch Date: Tue, 21 Nov 2023 09:50:46 +0100 Subject: [PATCH 8/8] upgrade sphinx, fix grammar issues --- doc/conf.py | 2 +- doc/features/teller.rst | 6 +++--- doc/requirements.txt | 6 +++--- doc/spelling_word_list.txt | 2 ++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 13480774..1bd0489e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -78,7 +78,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/doc/features/teller.rst b/doc/features/teller.rst index b94335c8..36514b12 100644 --- a/doc/features/teller.rst +++ b/doc/features/teller.rst @@ -24,14 +24,14 @@ The Teller offers these methods: * operation - * ``absolute($amount) : string`` Returns an absoute monetary amount. + * ``absolute($amount) : string`` Returns an absolute monetary amount. * ``add($amount, $other, ...$others) : string`` Adds one or more monetary amounts to a monetary amount. * ``divide($amount, $divisor) : string`` Divides a monetary amount by a divisor. - * ``mod($amount, $divisor)`` Retuns the mod of one amount by another. + * ``mod($amount, $divisor)`` Returns the mod of one amount by another. * ``multiply($amount, $multiplier) : string`` Multiplies a monetary amount by a multiplier. * ``negative($amount) : string`` Negates a monetary amount. * ``ratioOf($amount, $other)`` Determines the ratio of one monetary amount to another. - * ``subtract($amount, $other, ...$others) : string`` Subracts one or more monetary amounts from a monetary amount. + * ``subtract($amount, $other, ...$others) : string`` Subtracts one or more monetary amounts from a monetary amount. * comparison diff --git a/doc/requirements.txt b/doc/requirements.txt index cadd6883..868f60ea 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ git+https://github.com/fabpot/sphinx-php.git -sphinx~=4.3.1 -sphinx-rtd-theme==1.0.0 +sphinx~=7.2.6 +sphinx-rtd-theme~=1.3.0 git+https://github.com/markstory/sphinxcontrib-phpdomain.git -sphinxcontrib-spelling==7.2.1 +sphinxcontrib-spelling==8.0.0 pyenchant diff --git a/doc/spelling_word_list.txt b/doc/spelling_word_list.txt index 788c4f35..26392097 100644 --- a/doc/spelling_word_list.txt +++ b/doc/spelling_word_list.txt @@ -1,5 +1,7 @@ amongst integrations +codebases +formatter formatters eg Bitcoin