File tree 4 files changed +7
-18
lines changed
4 files changed +7
-18
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace Khandurdyiev \MonoClient \Entities \ClientInfo ;
6
6
7
- use Alcohol \ISO4217 as AlcoholISO4217 ;
8
7
use Khandurdyiev \MonoClient \ISO4217 ;
9
8
use Khandurdyiev \MonoClient \Utils \Utils ;
10
9
@@ -21,7 +20,6 @@ class Account implements \JsonSerializable
21
20
* @var array<int, string>
22
21
*/
23
22
private array $ maskedPan ;
24
- private ISO4217 $ iso4217 ;
25
23
26
24
/**
27
25
* @param array<string, mixed> $account
@@ -36,7 +34,6 @@ public function __construct(array $account)
36
34
$ this ->type = (string )$ account ['type ' ];
37
35
$ this ->iban = (string )$ account ['iban ' ];
38
36
$ this ->maskedPan = (array )$ account ['maskedPan ' ];
39
- $ this ->iso4217 = new ISO4217 (new AlcoholISO4217 ());
40
37
}
41
38
42
39
/**
@@ -71,7 +68,7 @@ public function getCurrencyCode(): int
71
68
72
69
public function getCurrency (): string
73
70
{
74
- return $ this -> iso4217 ->getByNumeric ($ this ->currencyCode );
71
+ return ISO4217 :: create () ->getByNumeric ($ this ->currencyCode );
75
72
}
76
73
77
74
public function getCashbackType (): string
Original file line number Diff line number Diff line change 4
4
5
5
namespace Khandurdyiev \MonoClient \Entities \Currency ;
6
6
7
- use Alcohol \ISO4217 as AlcoholISO4217 ;
8
7
use Khandurdyiev \MonoClient \ISO4217 ;
9
8
use Carbon \Carbon ;
10
9
@@ -16,7 +15,6 @@ class Currency implements \JsonSerializable
16
15
private ?float $ rateSell ;
17
16
private ?float $ rateBuy ;
18
17
private ?float $ rateCross ;
19
- private ISO4217 $ iso4217 ;
20
18
21
19
/**
22
20
* @param array<string, mixed> $currency
@@ -29,7 +27,6 @@ public function __construct(array $currency)
29
27
$ this ->rateSell = isset ($ currency ['rateSell ' ]) ? (float ) $ currency ['rateSell ' ] : null ;
30
28
$ this ->rateBuy = isset ($ currency ['rateBuy ' ]) ? (float ) $ currency ['rateBuy ' ] : null ;
31
29
$ this ->rateCross = isset ($ currency ['rateCross ' ]) ? (float ) $ currency ['rateCross ' ] : null ;
32
- $ this ->iso4217 = new ISO4217 (new AlcoholISO4217 ());
33
30
}
34
31
35
32
/**
@@ -54,12 +51,12 @@ public function getCurrencyCodeB(): int
54
51
55
52
public function getCurrencyA (): string
56
53
{
57
- return $ this -> iso4217 ->getByNumeric ($ this ->currencyCodeA );
54
+ return ISO4217 :: create () ->getByNumeric ($ this ->currencyCodeA );
58
55
}
59
56
60
57
public function getCurrencyB (): string
61
58
{
62
- return $ this -> iso4217 ->getByNumeric ($ this ->currencyCodeB );
59
+ return ISO4217 :: create () ->getByNumeric ($ this ->currencyCodeB );
63
60
}
64
61
65
62
public function getTimestamp (): int
Original file line number Diff line number Diff line change 4
4
5
5
namespace Khandurdyiev \MonoClient \Entities \Statement ;
6
6
7
- use Alcohol \ISO4217 as AlcoholISO4217 ;
8
7
use Khandurdyiev \MonoClient \ISO4217 ;
9
8
use Khandurdyiev \MonoClient \Utils \Utils ;
10
9
@@ -25,7 +24,6 @@ class Statement implements \JsonSerializable
25
24
private string $ receiptId ;
26
25
private string $ counterEdrpou ;
27
26
private string $ counterIban ;
28
- private ISO4217 $ iso4217 ;
29
27
30
28
/**
31
29
* @param array<string, mixed> $statement
@@ -47,7 +45,6 @@ public function __construct(array $statement)
47
45
$ this ->receiptId = $ statement ['receiptId ' ] ?? '' ;
48
46
$ this ->counterEdrpou = $ statement ['counterEdrpou ' ] ?? '' ;
49
47
$ this ->counterIban = $ statement ['counterIban ' ] ?? '' ;
50
- $ this ->iso4217 = new ISO4217 (new AlcoholISO4217 ());
51
48
}
52
49
53
50
/**
@@ -102,7 +99,7 @@ public function getCurrencyCode(): int
102
99
103
100
public function getCurrency (): string
104
101
{
105
- return $ this -> iso4217 ->getByNumeric ($ this ->currencyCode );
102
+ return ISO4217 :: create () ->getByNumeric ($ this ->currencyCode );
106
103
}
107
104
108
105
public function getCommissionRate (): int
Original file line number Diff line number Diff line change 8
8
9
9
class ISO4217
10
10
{
11
- private AlcoholISO4217 $ iso4217 ;
12
-
13
- public function __construct (AlcoholISO4217 $ iso4217 )
11
+ public static function create (): ISO4217
14
12
{
15
- $ this -> iso4217 = $ iso4217 ;
13
+ return new self () ;
16
14
}
17
15
18
16
/**
@@ -26,7 +24,7 @@ public function getByNumeric(int $code): string
26
24
27
25
try {
28
26
/** @var string $code */
29
- $ code = $ this -> iso4217 ->getByNumeric ($ numeric )['alpha3 ' ];
27
+ $ code = ( new AlcoholISO4217 ()) ->getByNumeric ($ numeric )['alpha3 ' ];
30
28
31
29
return $ code ;
32
30
} catch (\OutOfBoundsException $ exception ) {
You can’t perform that action at this time.
0 commit comments