@@ -38,7 +38,7 @@ public function __construct(ClientInterface $client, string $tableType, string $
38
38
Assert::notEmpty ($ currencyCode );
39
39
Assert::maxLength ($ currencyCode , 3 );
40
40
41
- $ this ->currencyCode = $ currencyCode ;
41
+ $ this ->currencyCode = strtolower ( $ currencyCode) ;
42
42
}
43
43
44
44
/**
@@ -49,7 +49,7 @@ public function __construct(ClientInterface $client, string $tableType, string $
49
49
*/
50
50
public function all (): ResponseInterface
51
51
{
52
- return $ this ->get (sprintf ('exchangerates/rates/%s/%s ' , $ this ->currencyCode , $ this ->tableType ));
52
+ return $ this ->get (sprintf ('exchangerates/rates/%s/%s ' , $ this ->tableType , $ this ->currencyCode ));
53
53
}
54
54
55
55
/**
@@ -62,7 +62,7 @@ public function all(): ResponseInterface
62
62
*/
63
63
public function latest (int $ count ): ResponseInterface
64
64
{
65
- return $ this ->get (sprintf ('exchangerates/rates/%s/%s/last/%d ' , $ this ->currencyCode , $ this ->tableType , $ count ));
65
+ return $ this ->get (sprintf ('exchangerates/rates/%s/%s/last/%d ' , $ this ->tableType , $ this ->currencyCode , $ count ));
66
66
}
67
67
68
68
/**
@@ -74,7 +74,7 @@ public function latest(int $count): ResponseInterface
74
74
*/
75
75
public function today (): ResponseInterface
76
76
{
77
- return $ this ->get (sprintf ('exchangerates/rates/%s/%s/today ' , $ this ->currencyCode , $ this ->tableType ));
77
+ return $ this ->get (sprintf ('exchangerates/rates/%s/%s/today ' , $ this ->tableType , $ this ->currencyCode ));
78
78
}
79
79
80
80
/**
@@ -90,8 +90,8 @@ public function inDate(DateTimeInterface $date): ResponseInterface
90
90
{
91
91
return $ this ->get (sprintf (
92
92
'exchangerates/rates/%s/%s/%s ' ,
93
- $ this ->currencyCode ,
94
93
$ this ->tableType ,
94
+ $ this ->currencyCode ,
95
95
$ date ->format (self ::DATE_FORMAT )
96
96
));
97
97
}
@@ -110,10 +110,10 @@ public function betweenDates(DateTimeInterface $startDate, DateTimeInterface $en
110
110
{
111
111
return $ this ->get (sprintf (
112
112
'exchangerates/rates/%s/%s/%s/%s ' ,
113
- $ this ->currencyCode ,
114
113
$ this ->tableType ,
114
+ $ this ->currencyCode ,
115
115
$ startDate ->format (self ::DATE_FORMAT ),
116
116
$ endDate ->format (self ::DATE_FORMAT )
117
117
));
118
118
}
119
- }
119
+ }
0 commit comments