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

fixed issue where __call method sometimes returned an \money\money ob… #3

Merged
merged 1 commit into from
Feb 22, 2024
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
/config/Migrations/schema-dump-default.lock
/vendor/
/.idea/
/.phpunit.cache
/.phpunit.cache
/.ddev/
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

* Fixed issue where `__call()` method sometimes returned an object with class \Money\Money instead of CakeDC\Money\.

## [0.0.1] - 2021-06-18

* Initial version
* Initial version
7 changes: 6 additions & 1 deletion src/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@
* @param $arguments
* @return false|mixed
*/
public function __call($name, $arguments)

Check failure on line 50 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 50 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 50 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 50 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);

return call_user_func_array([$this->_money, $name], $arguments);
$result = call_user_func_array([$this->_money, $name], $arguments);
if ($result instanceof MoneyPHP) {
return new self($result);
}

return $result;
}

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

Check failure on line 67 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 67 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 67 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 67 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 Down
Loading