Skip to content

Commit

Permalink
Merge branch '1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed May 31, 2018
2 parents 97ee638 + 3fd7b23 commit 4bf330b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG-1.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

This changelog references the relevant changes (bug and security fixes) done to `jomweb/ringgit`.

## 1.0.6

Released: 2018-05-29

### Fixes

* Fixes return value from `Duit\MYR::__call()` which isn't an instance of `Money\Money`.

## 1.0.5

Released: 2018-05-21
Expand Down
8 changes: 3 additions & 5 deletions src/MYR.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,9 @@ public function __call(string $method, array $parameters)
$this->resolveMoneyObject($first), ...$parameters
);

if (in_array($method, ['add', 'subtract'])) {
return $this->newInstance($resolved);
}

return $resolved;
return $resolved instanceof Money
? $this->newInstance($resolved)
: $resolved;
}

return $this->newInstance(
Expand Down

0 comments on commit 4bf330b

Please sign in to comment.