Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHPDoc typings #121

Merged
merged 1 commit into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions src/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,32 @@
use ReflectionMethod;

/**
* @mixin \Money\Money
* Money.
*
* @method bool isSameCurrency(Money|\Money\Money ...$others)
* @method bool equals(Money|\Money\Money $other)
* @method int compare(Money|\Money\Money $other)
* @method bool greaterThan(Money|\Money\Money $other)
* @method bool greaterThanOrEqual(Money|\Money\Money $other)
* @method bool lessThan(Money|\Money\Money $other)
* @method bool lessThanOrEqual(Money|\Money\Money $other)
* @method string getAmount()
* @method \Money\Currency getCurrency()
* @method Money add(Money|\Money\Money ...$addends)
* @method Money subtract(Money|\Money\Money ...$subtrahends)
* @method Money mod(Money|\Money\Money $divisor)
* @method Money[] allocate(array $ratios)
* @method Money[] allocateTo(int $n)
* @method string ratioOf(Money|\Money\Money $money)
* @method Money absolute()
* @method Money negative()
* @method bool isZero()
* @method bool isPositive()
* @method bool isNegative()
* @method static Money min(Money|\Money\Money $first, Money|\Money\Money ...$collection)
* @method static Money max(Money|\Money\Money $first, Money|\Money\Money ...$collection)
* @method static Money sum(Money|\Money\Money $first, Money|\Money\Money ...$collection)
* @method static Money avg(Money|\Money\Money $first, Money|\Money\Money ...$collection)
*/
class Money implements Arrayable, Jsonable, JsonSerializable, Renderable
{
Expand Down Expand Up @@ -192,8 +217,8 @@ public function __call($method, array $arguments)
$methods = [
'add', 'subtract',
'multiply', 'divide', 'mod',
'absolute', 'negative',
'allocate', 'allocateTo',
'absolute', 'negative',
];

if (! in_array($method, $methods)) {
Expand Down
2 changes: 1 addition & 1 deletion src/MoneyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Cknow\Money;

/**
* Money.
* Money Factory.
*
* @method static Money AED(mixed $amount, bool $forceDecimals = false, string|null $locale = null, \Money\Currencies|null $currencies = null)
* @method static Money ALL(mixed $amount, bool $forceDecimals = false, string|null $locale = null, \Money\Currencies|null $currencies = null)
Expand Down