Skip to content

Commit

Permalink
Clean up redundant docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Dec 11, 2020
1 parent 991a050 commit 2d9a1a1
Show file tree
Hide file tree
Showing 16 changed files with 73 additions and 396 deletions.
41 changes: 0 additions & 41 deletions tests/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
*/
abstract class AbstractTestCase extends TestCase
{
/**
* @param string $expected
* @param BigDecimal $actual
*
* @return void
*/
final protected function assertBigDecimalIs(string $expected, BigDecimal $actual) : void
{
self::assertSame($expected, (string) $actual);
Expand All @@ -36,8 +30,6 @@ final protected function assertBigDecimalIs(string $expected, BigDecimal $actual
* @param string $expectedAmount The expected decimal amount.
* @param string $expectedCurrency The expected currency code.
* @param Money $actual The money to test.
*
* @return void
*/
final protected function assertMoneyEquals(string $expectedAmount, string $expectedCurrency, Money $actual) : void
{
Expand All @@ -49,8 +41,6 @@ final protected function assertMoneyEquals(string $expectedAmount, string $expec
* @param string $expected The expected string representation of the Money.
* @param Money $actual The money to test.
* @param Context|null $context An optional context to check against the Money.
*
* @return void
*/
final protected function assertMoneyIs(string $expected, Money $actual, ?Context $context = null) : void
{
Expand All @@ -64,8 +54,6 @@ final protected function assertMoneyIs(string $expected, Money $actual, ?Context
/**
* @param string[] $expected
* @param Money[] $actual
*
* @return void
*/
final protected function assertMoniesAre(array $expected, array $actual) : void
{
Expand All @@ -77,23 +65,11 @@ final protected function assertMoniesAre(array $expected, array $actual) : void
self::assertSame($expected, $actual);
}

/**
* @param string $expected
* @param BigNumber $actual
*
* @return void
*/
final protected function assertBigNumberEquals(string $expected, BigNumber $actual) : void
{
self::assertTrue($actual->isEqualTo($expected), $actual . ' != ' . $expected);
}

/**
* @param array $expectedAmounts
* @param MoneyBag $moneyBag
*
* @return void
*/
final protected function assertMoneyBagContains(array $expectedAmounts, MoneyBag $moneyBag) : void
{
// Test get() on each currency
Expand All @@ -113,26 +89,11 @@ final protected function assertMoneyBagContains(array $expectedAmounts, MoneyBag
}
}

/**
* @param string $expected
* @param RationalMoney $actual
*
* @return void
*/
final protected function assertRationalMoneyEquals(string $expected, RationalMoney $actual) : void
{
self::assertSame($expected, (string) $actual);
}

/**
* @param string $currencyCode
* @param int $numericCode
* @param string $name
* @param int $defaultFractionDigits
* @param Currency $currency
*
* @return void
*/
final protected function assertCurrencyEquals(string $currencyCode, int $numericCode, string $name, int $defaultFractionDigits, Currency $currency) : void
{
self::assertSame($currencyCode, $currency->getCurrencyCode());
Expand All @@ -143,8 +104,6 @@ final protected function assertCurrencyEquals(string $currencyCode, int $numeric

/**
* @param mixed $value
*
* @return bool
*/
final protected function isExceptionClass($value) : bool
{
Expand Down
8 changes: 0 additions & 8 deletions tests/Context/AutoContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ class AutoContextTest extends AbstractTestCase
{
/**
* @dataProvider providerApplyTo
*
* @param string $amount
* @param string $currency
* @param int $roundingMode
* @param string $expected
*/
public function testApplyTo(string $amount, string $currency, int $roundingMode, string $expected) : void
{
Expand All @@ -44,9 +39,6 @@ public function testApplyTo(string $amount, string $currency, int $roundingMode,
}
}

/**
* @return array
*/
public function providerApplyTo() : array
{
return [
Expand Down
9 changes: 0 additions & 9 deletions tests/Context/CashContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ class CashContextTest extends AbstractTestCase
{
/**
* @dataProvider providerApplyTo
*
* @param int $step
* @param string $amount
* @param string $currency
* @param int $roundingMode
* @param string $expected
*/
public function testApplyTo(int $step, string $amount, string $currency, int $roundingMode, string $expected) : void
{
Expand All @@ -44,9 +38,6 @@ public function testApplyTo(int $step, string $amount, string $currency, int $ro
}
}

/**
* @return array
*/
public function providerApplyTo() : array
{
return [
Expand Down
10 changes: 0 additions & 10 deletions tests/Context/CustomContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ class CustomContextTest extends AbstractTestCase
{
/**
* @dataProvider providerApplyTo
*
* @param int $scale
* @param int $step
* @param string $amount
* @param string $currency
* @param int $roundingMode
* @param string $expected
*/
public function testApplyTo(int $scale, int $step, string $amount, string $currency, int $roundingMode, string $expected) : void
{
Expand All @@ -45,9 +38,6 @@ public function testApplyTo(int $scale, int $step, string $amount, string $curre
}
}

/**
* @return array
*/
public function providerApplyTo() : array
{
return [
Expand Down
8 changes: 0 additions & 8 deletions tests/Context/DefaultContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ class DefaultContextTest extends AbstractTestCase
{
/**
* @dataProvider providerApplyTo
*
* @param string $amount
* @param string $currency
* @param int $roundingMode
* @param string $expected
*/
public function testApplyTo(string $amount, string $currency, int $roundingMode, string $expected) : void
{
Expand All @@ -43,9 +38,6 @@ public function testApplyTo(string $amount, string $currency, int $roundingMode,
}
}

/**
* @return array
*/
public function providerApplyTo() : array
{
return [
Expand Down
23 changes: 4 additions & 19 deletions tests/CurrencyConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
*/
class CurrencyConverterTest extends AbstractTestCase
{
/**
* @return CurrencyConverter
*/
private function createCurrencyConverter() : CurrencyConverter
{
$exchangeRateProvider = new ConfigurableProvider();
Expand Down Expand Up @@ -60,9 +57,6 @@ public function testConvertMoney(array $money, string $toCurrency, int $rounding
}
}

/**
* @return array
*/
public function providerConvertMoney() : array
{
return [
Expand All @@ -84,7 +78,7 @@ public function providerConvertMoney() : array
/**
* @dataProvider providerConvertMoneyBag
*
* @param array $monies The mixed monies to add.
* @param array $monies The mixed currency monies to add.
* @param string $currency The target currency code.
* @param Context $context The target context.
* @param int $roundingMode The rounding mode to use.
Expand All @@ -107,9 +101,6 @@ public function testConvertMoneyBag(array $monies, string $currency, Context $co
$this->assertMoneyIs($total, $currencyConverter->convert($moneyBag, $currency, $roundingMode));
}

/**
* @return array
*/
public function providerConvertMoneyBag() : array
{
return [
Expand All @@ -124,9 +115,9 @@ public function providerConvertMoneyBag() : array
/**
* @dataProvider providerConvertMoneyBagToRational
*
* @param array $monies The mixed monies to add.
* @param string $currency The target currency code.
* @param string $expectedTotal The expected total.
* @param array $monies The mixed monies to add.
* @param string $currency The target currency code.
* @param string $expectedTotal The expected total.
*/
public function testConvertMoneyBagToRational(array $monies, string $currency, string $expectedTotal) : void
{
Expand All @@ -147,9 +138,6 @@ public function testConvertMoneyBagToRational(array $monies, string $currency, s
$this->assertRationalMoneyEquals($expectedTotal, $actualTotal);
}

/**
* @return array
*/
public function providerConvertMoneyBagToRational() : array
{
return [
Expand Down Expand Up @@ -183,9 +171,6 @@ public function testConvertRationalMoney(array $money, string $toCurrency, int $
}
}

/**
* @return array
*/
public function providerConvertRationalMoney() : array
{
return [
Expand Down
12 changes: 0 additions & 12 deletions tests/CurrencyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public function testOf(string $currencyCode, int $numericCode, int $fractionDigi
$this->assertCurrencyEquals($currencyCode, $numericCode, $name, $fractionDigits, $currency);
}

/**
* @return array
*/
public function providerOf() : array
{
return [
Expand All @@ -54,9 +51,6 @@ public function testOfUnknownCurrencyCode($currencyCode) : void
Currency::of($currencyCode);
}

/**
* @return array
*/
public function providerOfUnknownCurrencyCode() : array
{
return [
Expand All @@ -78,9 +72,6 @@ public function testOfReturnsSameInstance() : void

/**
* @dataProvider providerOfCountry
*
* @param string $countryCode
* @param string $expected
*/
public function testOfCountry(string $countryCode, string $expected) : void
{
Expand All @@ -96,9 +87,6 @@ public function testOfCountry(string $countryCode, string $expected) : void
}
}

/**
* @return array
*/
public function providerOfCountry() : array
{
return [
Expand Down
Loading

0 comments on commit 2d9a1a1

Please sign in to comment.