diff --git a/src/Concerns/Cash.php b/src/Concerns/Cash.php index f632e33..efb4e0e 100644 --- a/src/Concerns/Cash.php +++ b/src/Concerns/Cash.php @@ -9,6 +9,8 @@ trait Cash { /** * Get formatted amount. + * + * @return numeric-string */ public function amount(): string { @@ -17,6 +19,8 @@ public function amount(): string /** * Get formatted cash. + * + * @return numeric-string */ public function cashAmount(): string { @@ -27,6 +31,8 @@ public function cashAmount(): string /** * Get amount for cash. + * + * @return numeric-string */ public function getCashAmount(): string { @@ -38,7 +44,7 @@ public function getCashAmount(): string /** * Get closest accepted cash amount. * - * @param int|string $amount + * @param int|numeric-string $amount */ protected function getClosestAcceptedCashAmount($amount): int { diff --git a/src/Concerns/Gst.php b/src/Concerns/Gst.php index 8d5bd5a..577ecab 100644 --- a/src/Concerns/Gst.php +++ b/src/Concerns/Gst.php @@ -12,7 +12,7 @@ trait Gst /** * Make object with GST. * - * @param int|string $amount + * @param int|numeric-string $amount * * @return static */ @@ -24,7 +24,7 @@ public static function afterGst($amount) /** * Make object before applying GST. * - * @param int|string $amount + * @param int|numeric-string $amount * * @return static */ @@ -36,7 +36,7 @@ public static function beforeGst($amount) /** * Make object without GST. * - * @param int|string $amount + * @param int|numeric-string $amount * * @return static */ diff --git a/src/Concerns/Tax.php b/src/Concerns/Tax.php index febe942..25494ec 100644 --- a/src/Concerns/Tax.php +++ b/src/Concerns/Tax.php @@ -20,7 +20,7 @@ trait Tax /** * Make object with Tax. * - * @param int|string $amount + * @param int|numeric-string $amount * @param \Duit\Contracts\Taxable $taxable * * @return static @@ -35,7 +35,7 @@ public static function afterTax($amount, Taxable $taxable) /** * Make object before applying Tax. * - * @param int|string $amount + * @param int|numeric-string $amount * @param \Duit\Contracts\Taxable $taxable * * @return static @@ -48,7 +48,7 @@ public static function beforeTax($amount, Taxable $taxable) /** * Make object without Tax. * - * @param int|string $amount + * @param int|numeric-string $amount * * @return static */ @@ -59,6 +59,8 @@ public static function withoutTax($amount) /** * Get formatted amount with GST. + * + * @return numeric-string */ public function amountWithTax(): string { @@ -69,6 +71,8 @@ public function amountWithTax(): string /** * Get formatted cash with GST. + * + * @return numeric-string */ public function cashAmountWithTax(): string { @@ -111,6 +115,8 @@ final public function hasTax(): bool /** * Get GST amount. + * + * @return numeric-string */ public function getTaxAmount(): string { @@ -123,6 +129,8 @@ public function getTaxAmount(): string /** * Returns the value represented by this object with Tax. + * + * @return numeric-string */ public function getAmountWithTax(): string { @@ -135,6 +143,8 @@ public function getAmountWithTax(): string /** * Get amount for cash with Tax. + * + * @return numeric-string */ public function getCashAmountWithTax(): string { @@ -146,7 +156,7 @@ public function getCashAmountWithTax(): string /** * Allocate the money according to a list of ratios with Tax. * - * @return Money[] + * @return array */ public function allocateWithTax(array $ratios): array { @@ -168,7 +178,7 @@ public function allocateWithTax(array $ratios): array * @param int<1, max> $n * @throws \InvalidArgumentException If number of targets is not an integer * - * @return Money[] + * @return array */ public function allocateWithTaxTo(int $n): array { @@ -197,7 +207,7 @@ abstract public function getMoney(): Money; /** * Build money object. * - * @param int|string $amount + * @param int|numeric-string $amount */ abstract protected static function asMoney($amount): Money; diff --git a/src/Contracts/Money.php b/src/Contracts/Money.php index d681fff..571d6de 100644 --- a/src/Contracts/Money.php +++ b/src/Contracts/Money.php @@ -6,6 +6,8 @@ interface Money { /** * Returns the value represented by this object. + * + * @return numeric-string */ public function getAmount(): string; diff --git a/src/Contracts/Taxable.php b/src/Contracts/Taxable.php index aa3c795..23874fe 100644 --- a/src/Contracts/Taxable.php +++ b/src/Contracts/Taxable.php @@ -8,16 +8,22 @@ interface Taxable { /** * Get tax percentage. + * + * @return numeric-string */ public function getAmountWithoutTax(MoneyContract $money): string; /** * Get tax percentage. + * + * @return numeric-string */ public function getAmountWithTax(MoneyContract $money): string; /** * Get tax percentage. + * + * @return numeric-string */ public function getTaxAmount(MoneyContract $money): string; diff --git a/src/MYR.php b/src/MYR.php index f814b08..7224bdf 100644 --- a/src/MYR.php +++ b/src/MYR.php @@ -32,7 +32,7 @@ class MYR implements Contracts\Money, \JsonSerializable /** * Construct a new MYR money. * - * @param int|string $amount + * @param int|numeric-string $amount */ public function __construct($amount) { @@ -42,7 +42,7 @@ public function __construct($amount) /** * Construct a new MYR money. * - * @param int|string $amount + * @param int|numeric-string $amount * * @return static */ @@ -54,7 +54,7 @@ public static function given($amount) /** * Parse value as ringgit. * - * @param string|array $value + * @param numeric-string|array $value * * @return static */ @@ -78,6 +78,8 @@ public static function parse($value) /** * Returns the value represented by this object. + * + * @return numeric-string */ public function getAmount(): string { diff --git a/src/Taxable.php b/src/Taxable.php index 7076886..2cc11f7 100644 --- a/src/Taxable.php +++ b/src/Taxable.php @@ -23,6 +23,8 @@ abstract class Taxable implements Contracts\Taxable /** * Get tax percentage. + * + * @return numeric-string */ public function getAmountWithoutTax(Money $money): string { @@ -31,6 +33,8 @@ public function getAmountWithoutTax(Money $money): string /** * Get tax percentage. + * + * @return numeric-string */ public function getAmountWithTax(Money $money): string { @@ -39,6 +43,8 @@ public function getAmountWithTax(Money $money): string /** * Get tax percentage. + * + * @return numeric-string */ public function getTaxAmount(Money $money): string {