diff --git a/.gitignore b/.gitignore index 138ff77..56b0dbd 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /vendor/ /.idea/ /.phpunit.cache +/.ddev/ diff --git a/CHANGELOG.md b/CHANGELOG.md index d9e0afd..63cedae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.0.1] - 2024-02-23 +- Ported changes applied in tag `1.0.1` + +## [1.0.1] - 2024-02-23 + +### Fixed +- Fixed issue where `__call()` method sometimes returned an object with class `\Money\Money` instead of `\CakeDC\Money\Money`. + ## [0.0.1] - 2021-06-18 -* Initial version \ No newline at end of file +* Initial version diff --git a/src/Money.php b/src/Money.php index 2ebc7cf..cc2a55a 100644 --- a/src/Money.php +++ b/src/Money.php @@ -51,7 +51,12 @@ public function __call($name, $arguments) { $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; } /**