File tree 5 files changed +47
-10
lines changed
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.
16
16
17
17
## [ Unreleased]
18
18
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.
20
44
21
45
## 1.0.1 (2019-03-05)
22
46
23
47
### Fixed
48
+
24
49
+ Fixed pretty-print formatting of negative amount of money
25
50
26
51
## 1.0.0 (2018-12-08)
Original file line number Diff line number Diff line change 1
1
[ ![ Software License] [ ico-license ]] [ link-license ]
2
2
[ ![ Latest Version on Packagist] [ ico-version ]] [ link-packagist ]
3
- [ ![ Build Status] [ ico-travis ]] [ link-travis ]
4
- [ ![ Coverage Status] [ ico-coveralls ]] [ link-coveralls ]
5
3
[ ![ GitHub Actions status] [ ico-github-actions ]] [ link-github ]
6
4
7
5
# Money
@@ -248,11 +246,7 @@ The Money library is open-sourced under the [MIT License](./LICENSE) distributed
248
246
[ ico-github-actions ] : https://github.com/Rebilly/money/workflows/Tests/badge.svg
249
247
[ ico-version ] : https://img.shields.io/packagist/v/Rebilly/money.svg?style=flat-square
250
248
[ 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
253
249
254
250
[ link-github ] : https://github.com/Rebilly/money
255
251
[ link-packagist ] : https://packagist.org/packages/Rebilly/money
256
252
[ 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
81
81
return $ money ->convert ($ this ->currencyPair ->getQuoteCurrency (), $ this ->ratio , PHP_ROUND_HALF_UP );
82
82
}
83
83
84
+ public function withRatio (float $ ratio ): self
85
+ {
86
+ return new self ($ this ->getCurrencyPair (), $ this ->getDate (), $ ratio );
87
+ }
88
+
84
89
/**
85
90
* {@inheritdoc}
86
91
*/
Original file line number Diff line number Diff line change @@ -31,6 +31,22 @@ public function testCanBeConstructed()
31
31
return $ rate ;
32
32
}
33
33
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
+
34
50
/**
35
51
* @depends testCanBeConstructed
36
52
*
You can’t perform that action at this time.
0 commit comments