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

Ported fix applied in version 1.0.1 to cake5 branch #4

Merged
merged 1 commit into from
Feb 23, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/vendor/
/.idea/
/.phpunit.cache
/.ddev/
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
* Initial version
7 changes: 6 additions & 1 deletion src/Money.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php

Check failure on line 1 in src/Money.php

View workflow job for this annotation

GitHub Actions / Coding Standard & Static Analysis

Internal error: PhpParser\Lexer::getNextToken(): Return value must be of type int, null returned Run PHPStan with --debug option and post the stack trace to: https://github.com/phpstan/phpstan/issues/new?template=Bug_report.md
/**
* Copyright 2021, Cake Development Corporation (https://www.cakedc.com)
*
Expand Down Expand Up @@ -51,7 +51,12 @@
{
$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 Down
Loading