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

improved code completion for class \CakeDC\Money\Money #5

Merged
merged 1 commit into from
Mar 1, 2024
Merged
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
44 changes: 44 additions & 0 deletions src/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,54 @@
*
* This class encapsulates MoneyPHP\Money and extends features
*
* @method bool isSameCurrency(\CakeDC\Money\Money $other) See \Money\Money::isSameCurrency()
* @method bool equals(\CakeDC\Money\Money $other) See \Money\Money::equals()
* @method int compare(\CakeDC\Money\Money $other) See \Money\Money::compare()
* @method bool greaterThan(\CakeDC\Money\Money $other) See \Money\Money::greaterThan()
* @method bool greaterThanOrEqual(\CakeDC\Money\Money $other) See \Money\Money::greaterThanOrEqual()
* @method bool lessThan(\CakeDC\Money\Money $other) See \Money\Money::lessThan()
* @method bool lessThanOrEqual(\CakeDC\Money\Money $other) See \Money\Money::lessThanOrEqual()
* @method string getAmount() See \Money\Money::getAmount()
* @method \Money\Currency getCurrency() See \Money\Money::getCurrency()
* @method \CakeDC\Money\Money add(\CakeDC\Money\Money ...$addends) See \Money\Money::add()
* @method \CakeDC\Money\Money subtract(\CakeDC\Money\Money ...$subtrahends) See \Money\Money::subtract()
* @method \CakeDC\Money\Money multiply($multiplier, $roundingMode = \CakeDC\Money\Money::ROUND_HALF_UP) See \Money\Money::multiply()
* @method \CakeDC\Money\Money divide($divisor, $roundingMode = \CakeDC\Money\Money::ROUND_HALF_UP) See \Money\Money::divide()
* @method \CakeDC\Money\Money mod(\CakeDC\Money\Money $divisor) See \Money\Money::mod()
* @method \CakeDC\Money\Money[] allocate(array $ratios) See \Money\Money::allocate()
* @method \CakeDC\Money\Money[] allocateTo($n) See \Money\Money::allocateTo()
* @method string ratioOf(Money $money) See \Money\Money::ratioOf()
* @method \CakeDC\Money\Money absolute() See \Money\Money::absolute()
* @method \CakeDC\Money\Money negative() See \Money\Money::negative()
* @method bool isZero() See \Money\Money::isZero()
* @method bool isPositive() See \Money\Money::isPositive()
* @method bool isNegative() See \Money\Money::isNegative()
* @method bool jsonSerialize() See \Money\Money::jsonSerialize()
* @method static \CakeDC\Money\Money min(\CakeDC\Money\Money $first, \CakeDC\Money\Money ...$collection) See \Money\Money::min()
* @method static \CakeDC\Money\Money max(\CakeDC\Money\Money $first, \CakeDC\Money\Money ...$collection) See \Money\Money::max()
* @method static \CakeDC\Money\Money sum(\CakeDC\Money\Money $first, \CakeDC\Money\Money ...$collection) See \Money\Money::sum()
* @method static \CakeDC\Money\Money avg(\CakeDC\Money\Money $first, \CakeDC\Money\Money ...$collection) See \Money\Money::avg()
* @method static void registerCalculator(string $calculator) See \Money\Money::registerCalculator()
* @see \Money\Money
* @package CakeDC\Money
*/
class Money
{
const ROUND_HALF_UP = PHP_ROUND_HALF_UP;

const ROUND_HALF_DOWN = PHP_ROUND_HALF_DOWN;

const ROUND_HALF_EVEN = PHP_ROUND_HALF_EVEN;

const ROUND_HALF_ODD = PHP_ROUND_HALF_ODD;

const ROUND_UP = 5;

const ROUND_DOWN = 6;

const ROUND_HALF_POSITIVE_INFINITY = 7;

const ROUND_HALF_NEGATIVE_INFINITY = 8;

/**
* @var MoneyPHP
Expand All @@ -47,7 +91,7 @@
* @param $arguments
* @return false|mixed
*/
public function __call($name, $arguments)

Check failure on line 94 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Method CakeDC\Money\Money::__call() has parameter $arguments with no typehint specified.

Check failure on line 94 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Method CakeDC\Money\Money::__call() has parameter $name with no typehint specified.

Check failure on line 94 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

PHPDoc tag @param has invalid value ($arguments): Unexpected token "$arguments", expected type at offset 38

Check failure on line 94 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

PHPDoc tag @param has invalid value ($name): Unexpected token "$name", expected type at offset 18

Check failure on line 94 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Method CakeDC\Money\Money::__call() has parameter $arguments with no typehint specified.

Check failure on line 94 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Method CakeDC\Money\Money::__call() has parameter $name with no typehint specified.

Check failure on line 94 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

PHPDoc tag @param has invalid value ($arguments): Unexpected token "$arguments", expected type at offset 38

Check failure on line 94 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

PHPDoc tag @param has invalid value ($name): Unexpected token "$name", expected type at offset 18
{
$arguments = self::processArguments($arguments);

Expand All @@ -64,7 +108,7 @@
* @param $arguments
* @return false|mixed
*/
public static function __callStatic($name, $arguments)

Check failure on line 111 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Method CakeDC\Money\Money::__callStatic() has parameter $arguments with no typehint specified.

Check failure on line 111 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Method CakeDC\Money\Money::__callStatic() has parameter $name with no typehint specified.

Check failure on line 111 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

PHPDoc tag @param has invalid value ($arguments): Unexpected token "$arguments", expected type at offset 38

Check failure on line 111 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

PHPDoc tag @param has invalid value ($name): Unexpected token "$name", expected type at offset 18

Check failure on line 111 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Method CakeDC\Money\Money::__callStatic() has parameter $arguments with no typehint specified.

Check failure on line 111 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Method CakeDC\Money\Money::__callStatic() has parameter $name with no typehint specified.

Check failure on line 111 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

PHPDoc tag @param has invalid value ($arguments): Unexpected token "$arguments", expected type at offset 38

Check failure on line 111 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

PHPDoc tag @param has invalid value ($name): Unexpected token "$name", expected type at offset 18
{
$arguments = self::processArguments($arguments);

Expand All @@ -83,7 +127,7 @@
* @param array $arguments
* @return array
*/
protected static function processArguments($arguments = [])

Check failure on line 130 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Method CakeDC\Money\Money::processArguments() has parameter $arguments with no value type specified in iterable type array.

Check failure on line 130 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Method CakeDC\Money\Money::processArguments() has parameter $arguments with no value type specified in iterable type array.
{
for ($i=0; $i < count($arguments); $i++) {
if ($arguments[$i] instanceof Money) {
Expand Down
Loading