Skip to content

Commit f9f4065

Browse files
committed
feat: updated documentation
1 parent f5c9c22 commit f9f4065

File tree

4 files changed

+67
-27
lines changed

4 files changed

+67
-27
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
vendor
22
composer.lock
33
phpunit.xml
4+
..phpunit.result.cache

.phpunit.result.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":1,"defects":{"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testApcuCache":1},"times":{"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #0":0.003,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #1":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #2":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #3":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #4":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #5":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #6":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #7":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #8":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #9":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #10":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #11":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #12":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #13":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #14":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #15":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #16":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #17":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #18":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidProvidersConfig with data set #19":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #0":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #1":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #2":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #3":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #4":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #5":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #6":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #7":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #8":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #9":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #10":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #11":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #12":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #13":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #14":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #15":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #16":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #17":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #18":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #19":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #20":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #21":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #22":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #23":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidProvidersConfig with data set #24":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidCacheConfig with data set #0":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testValidCacheConfig with data set #1":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidCacheConfig with data set #0":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidCacheConfig with data set #1":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\ConfigurationTest::testInvalidCacheConfig with data set #2":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testBuilderService":0.003,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testSwapService":0.003,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testNoProvider":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testFixerProvider":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testForgeProvider":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testXchangeApiProvider":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testProviderPriorities":0.002,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testCacheMissTtl":0,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testArrayCache":0.001,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testApcuCache":0.001,"Florianv\\SwapBundle\\Tests\\DependencyInjection\\FlorianvSwapExtensionTest::testFilesystemCache":0.001}}

DependencyInjection/Configuration.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,39 @@ public function getConfigTreeBuilder()
5959
->end()
6060
->arrayNode('providers')
6161
->children()
62+
->arrayNode('apilayer_fixer')
63+
->children()
64+
->integerNode('priority')->defaultValue(0)->end()
65+
->scalarNode('api_key')
66+
->treatFalseLike(null)
67+
->treatTrueLike(null)
68+
->isRequired()
69+
->cannotBeEmpty()
70+
->end()
71+
->end()
72+
->end()
73+
->arrayNode('apilayer_currency_data')
74+
->children()
75+
->integerNode('priority')->defaultValue(0)->end()
76+
->scalarNode('api_key')
77+
->treatFalseLike(null)
78+
->treatTrueLike(null)
79+
->isRequired()
80+
->cannotBeEmpty()
81+
->end()
82+
->end()
83+
->end()
84+
->arrayNode('apilayer_exchange_rates_data')
85+
->children()
86+
->integerNode('priority')->defaultValue(0)->end()
87+
->scalarNode('api_key')
88+
->treatFalseLike(null)
89+
->treatTrueLike(null)
90+
->isRequired()
91+
->cannotBeEmpty()
92+
->end()
93+
->end()
94+
->end()
6295
->arrayNode('abstract_api')
6396
->children()
6497
->integerNode('priority')->defaultValue(0)->end()

README.md

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
[![Total Downloads](https://img.shields.io/packagist/dt/florianv/swap-bundle.svg?style=flat-square)](https://packagist.org/packages/florianv/swap-bundle)
55
[![Version](http://img.shields.io/packagist/v/florianv/swap-bundle.svg?style=flat-square)](https://packagist.org/packages/florianv/swap-bundle)
66

7-
Swap allows you to retrieve currency exchange rates from various services such as **[Fixer](https://fixer.io)**, **[currencylayer](https://currencylayer.com)**,
8-
**[exchangeratesapi](https://exchangeratesapi.io)** or **[Abstract](https://www.abstractapi.com)** and optionally cache the results.
7+
Swap allows you to retrieve currency exchange rates from various services such as **[Fixer](https://apilayer.com/marketplace/fixer-api)**, **[Currency Data](https://apilayer.com/marketplace/currency_data-api)**,
8+
**[Exchange Rates Data](https://apilayer.com/marketplace/exchangerates_data-api)** or **[Abstract](https://www.abstractapi.com)** and optionally cache the results.
99

1010
## Sponsors
1111

1212
<table>
1313
<tr>
14-
<td><img src="https://s3.amazonaws.com/swap.assets/fixer_icon.png?v=2" width="50px"/></td>
15-
<td><a href="https://fixer.io">Fixer</a> is a simple and lightweight API for foreign exchange rates that supports up to 170 world currencies.</td>
14+
<td><img src="https://assets.apilayer.com/apis/fixer.png" width="50px"/></td>
15+
<td><a href="https://apilayer.com/marketplace/fixer-api">Fixer</a> is a simple and lightweight API for foreign exchange rates that supports up to 170 world currencies.</td>
1616
</tr>
1717
<tr>
18-
<td><img src="https://s3.amazonaws.com/swap.assets/currencylayer_icon.png" width="50px"/></td>
19-
<td><a href="https://currencylayer.com">currencylayer</a> provides reliable exchange rates and currency conversions for your business up to 168 world currencies.</td>
18+
<td><img src="https://assets.apilayer.com/apis/currency_data.png" width="50px"/></td>
19+
<td><a href="https://apilayer.com/marketplace/currency_data-api">Currency Data</a> provides reliable exchange rates and currency conversions for your business up to 168 world currencies.</td>
2020
</tr>
2121
<tr>
22-
<td><img src="https://exchangeratesapi.io/assets/images/api-logo.svg" width="50px"/></td>
23-
<td><a href="https://exchangeratesapi.io">exchangeratesapi</a> provides reliable exchange rates and currency conversions for your business with over 15 data sources.</td>
22+
<td><img src="https://assets.apilayer.com/apis/exchangerates_data.png" width="50px"/></td>
23+
<td><a href="https://apilayer.com/marketplace/exchangerates_data-api">Exchange Rates Data</a> provides reliable exchange rates and currency conversions for your business with over 15 data sources.</td>
2424
</tr>
2525
<tr>
26-
<td><img src="https://global-uploads.webflow.com/5ebbd0a566a3996636e55959/5ec2ba27ede983917dbff22f_favicon.png" width="50px"/></td>
26+
<td><img src="https://global-uploads.webflow.com/5ebbd0a566a3996636e55959/5ec2ba29feeeb05d69160e7b_webclip.png" width="50px"/></td>
2727
<td><a href="https://www.abstractapi.com/">Abstract</a> provides simple exchange rates for developers and a dozen of APIs covering thousands of use cases.</td>
2828
</tr>
2929
</table>
@@ -42,24 +42,29 @@ The complete documentation can be found [here](https://github.com/florianv/symfo
4242

4343
Here is the list of the currently implemented services:
4444

45-
<table>
46-
<tr>
47-
<td><img src="https://s3.amazonaws.com/swap.assets/fixer_icon.png?v=2" width="50px"/></td>
48-
<td><a href="https://fixer.io">Fixer</a> is a simple and lightweight API for foreign exchange rates that supports up to 170 world currencies.</td>
49-
</tr>
50-
<tr>
51-
<td><img src="https://s3.amazonaws.com/swap.assets/currencylayer_icon.png" width="50px"/></td>
52-
<td><a href="https://currencylayer.com">currencylayer</a> provides reliable exchange rates and currency conversions for your business up to 168 world currencies.</td>
53-
</tr>
54-
<tr>
55-
<td><img src="https://exchangeratesapi.io/assets/images/api-logo.svg" width="50px"/></td>
56-
<td><a href="https://exchangeratesapi.io">exchangeratesapi</a> provides reliable exchange rates and currency conversions for your business with over 15 data sources.</td>
57-
</tr>
58-
<tr>
59-
<td><img src="https://global-uploads.webflow.com/5ebbd0a566a3996636e55959/5ec2ba27ede983917dbff22f_favicon.png" width="50px"/></td>
60-
<td><a href="https://www.abstractapi.com/">Abstract</a> provides simple exchange rates for developers and a dozen of APIs covering thousands of use cases.</td>
61-
</tr>
62-
</table>
45+
| Service | Base Currency | Quote Currency | Historical |
46+
|---------------------------------------------------------------------------|----------------------|----------------|----------------|
47+
| [Fixer](https://apilayer.com/marketplace/fixer-api) | EUR (free, no SSL), * (paid) | * | Yes |
48+
| [Currency Data](https://apilayer.com/marketplace/currency_data-api) | USD (free), * (paid) | * | Yes |
49+
| [Exchange Rates Data](https://apilayer.com/marketplace/exchangerates_data-api) | USD (free), * (paid) | * | Yes |
50+
| [Abstract](https://www.abstractapi.com) | * | * | Yes |
51+
| [coinlayer](https://coinlayer.com) | * Crypto (Limited standard currencies) | * Crypto (Limited standard currencies) | Yes |
52+
| [European Central Bank](https://www.ecb.europa.eu/home/html/index.en.html) | EUR | * | Yes |
53+
| [National Bank of Romania](http://www.bnr.ro) | RON, AED, AUD, BGN, BRL, CAD, CHF, CNY, CZK, DKK, EGP, EUR, GBP, HRK, HUF, INR, JPY, KRW, MDL, MXN, NOK, NZD, PLN, RSD, RUB, SEK, TRY, UAH, USD, XAU, XDR, ZAR | RON, AED, AUD, BGN, BRL, CAD, CHF, CNY, CZK, DKK, EGP, EUR, GBP, HRK, HUF, INR, JPY, KRW, MDL, MXN, NOK, NZD, PLN, RSD, RUB, SEK, TRY, UAH, USD, XAU, XDR, ZAR | Yes |
54+
| [Central Bank of the Republic of Turkey](http://www.tcmb.gov.tr) | * | TRY | Yes |
55+
| [Central Bank of the Czech Republic](https://www.cnb.cz) | * | CZK | Yes |
56+
| [Central Bank of Russia](https://cbr.ru) | * | RUB | Yes |
57+
| [Bulgarian National Bank](http://bnb.bg) | * | BGN | Yes |
58+
| [WebserviceX](http://www.webservicex.net) | * | * | No |
59+
| [1Forge](https://1forge.com) | * (free but limited or paid) | * (free but limited or paid) | No |
60+
| [Cryptonator](https://www.cryptonator.com) | * Crypto (Limited standard currencies) | * Crypto (Limited standard currencies) | No |
61+
| [CurrencyDataFeed](https://currencydatafeed.com) | * (free but limited or paid) | * (free but limited or paid) | No |
62+
| [Open Exchange Rates](https://openexchangerates.org) | USD (free), * (paid) | * | Yes |
63+
| [Xignite](https://www.xignite.com) | * | * | Yes |
64+
| [Currency Converter API](https://www.currencyconverterapi.com) | * | * | Yes (free but limited or paid) |
65+
| [xChangeApi.com](https://xchangeapi.com) | * | * | Yes |
66+
| [fastFOREX.io](https://www.fastforex.io) | USD (free), * (paid) | * | No |
67+
| Array | * | * | Yes |
6368

6469
## Credits
6570

0 commit comments

Comments
 (0)