File tree Expand file tree Collapse file tree 5 files changed +47
-10
lines changed
Expand file tree Collapse file tree 5 files changed +47
-10
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,11 +16,36 @@ Security - in case of vulnerabilities.
1616
1717## [ Unreleased]
1818
19- _ TBD_
19+ ### Changed
20+
21+ + Migrated CI from ** Travis CI** to ** GitHub Actions** .
22+ + Upgraded minimum PHP version to v7.3.
23+
24+ ### Added
25+
26+ + Added ` Rate::withRatio ` factory method to create modified value with specific ratio.
27+ + Added static analyzer into CI flow.
28+
29+ ## 1.0.3 (2019-12-05)
30+
31+ ### Fixed
32+
33+ + Reverted removal of deprecated currencies. See [ #6 ] ( https://github.com/Rebilly/money/pull/6 ) for details.
34+
35+ ### Added
36+
37+ + Added a property to ` Currency ` showing that it is deprecated.
38+
39+ ## 1.0.2 (2019-10-21)
40+
41+ ### Changed
42+
43+ + Updated currencies list: remove deprecated, added new, rename code of others. See [ #5 ] ( https://github.com/Rebilly/money/pull/5 ) for details.
2044
2145## 1.0.1 (2019-03-05)
2246
2347### Fixed
48+
2449+ Fixed pretty-print formatting of negative amount of money
2550
2651## 1.0.0 (2018-12-08)
Original file line number Diff line number Diff line change 11[ ![ Software License] [ ico-license ]] [ link-license ]
22[ ![ Latest Version on Packagist] [ ico-version ]] [ link-packagist ]
3- [ ![ Build Status] [ ico-travis ]] [ link-travis ]
4- [ ![ Coverage Status] [ ico-coveralls ]] [ link-coveralls ]
53[ ![ GitHub Actions status] [ ico-github-actions ]] [ link-github ]
64
75# Money
@@ -248,11 +246,7 @@ The Money library is open-sourced under the [MIT License](./LICENSE) distributed
248246[ ico-github-actions ] : https://github.com/Rebilly/money/workflows/Tests/badge.svg
249247[ ico-version ] : https://img.shields.io/packagist/v/Rebilly/money.svg?style=flat-square
250248[ ico-license ] : https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square
251- [ ico-travis ] : https://img.shields.io/travis/Rebilly/money/master.svg?style=flat-square
252- [ ico-coveralls ] : https://img.shields.io/coveralls/github/Rebilly/money.svg?style=flat-square
253249
254250[ link-github ] : https://github.com/Rebilly/money
255251[ link-packagist ] : https://packagist.org/packages/Rebilly/money
256252[ link-license ] : LICENSE
257- [ link-travis ] : https://travis-ci.org/Rebilly/money
258- [ link-coveralls ] : https://coveralls.io/github/Rebilly/money?branch=master
Original file line number Diff line number Diff line change @@ -81,6 +81,11 @@ public function convert(Money $money): Money
8181 return $ money ->convert ($ this ->currencyPair ->getQuoteCurrency (), $ this ->ratio , PHP_ROUND_HALF_UP );
8282 }
8383
84+ public function withRatio (float $ ratio ): self
85+ {
86+ return new self ($ this ->getCurrencyPair (), $ this ->getDate (), $ ratio );
87+ }
88+
8489 /**
8590 * {@inheritdoc}
8691 */
Original file line number Diff line number Diff line change @@ -31,6 +31,22 @@ public function testCanBeConstructed()
3131 return $ rate ;
3232 }
3333
34+ /**
35+ * @depends testCanBeConstructed
36+ */
37+ public function testCanBeRecreatedWithNewRatio (Rate $ rate )
38+ {
39+ $ ratio = $ rate ->getRatio () * 2 ;
40+ $ mutatedRatio = $ rate ->withRatio ($ ratio );
41+
42+ self ::assertNotSame ($ rate , $ mutatedRatio );
43+ self ::assertSame ($ rate ->getCurrencyPair (), $ mutatedRatio ->getCurrencyPair ());
44+ self ::assertSame ($ rate ->getDate (), $ mutatedRatio ->getDate ());
45+ self ::assertSame ($ ratio , $ mutatedRatio ->getRatio ());
46+
47+ return $ rate ;
48+ }
49+
3450 /**
3551 * @depends testCanBeConstructed
3652 *
You can’t perform that action at this time.
0 commit comments