Skip to content

Commit

Permalink
Merge pull request #105 from ddinchev/master
Browse files Browse the repository at this point in the history
Update swap towards latest exchanger version.
  • Loading branch information
florianv authored Apr 19, 2018
2 parents e7711ea + 0d4d35b commit 9948c8b
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use Swap\Builder;

// Build Swap with Fixer.io
$swap = (new Builder())
->add('fixer')
->add('fixer', ['access_key' => 'your-access-key'])
->build();

// Get the latest EUR/USD rate
Expand All @@ -48,23 +48,23 @@ The complete documentation can be found [here](https://github.com/florianv/swap/

Here is the list of the currently implemented services.

| Service | Base Currency | Quote Currency | Historical |
|---------------------------------------------------------------------------|----------------------|----------------|----------------|
| [Fixer](http://fixer.io) | * | * | Yes |
| [European Central Bank](http://www.ecb.europa.eu/home/html/index.en.html) | EUR | * | Yes |
| [Google](http://www.google.com/finance) | * | * | No |
| Service | Registry Alias | Base Currency | Quote Currency | Historical |
|----------------------------------------------------------------|---------------|----------------------|----------------|----------------|
| [Fixer](http://fixer.io) | `fixer` | * | * | Yes |
| [European Central Bank](http://www.ecb.europa.eu/home/html/index.en.html) | `european_central_bank` | EUR | * | Yes |
| [Google](http://www.google.com/finance) | `google` | * | * | No |
| [Open Exchange Rates](https://openexchangerates.org) | USD (free), * (paid) | * | Yes |
| [Xignite](https://www.xignite.com) | * | * | Yes |
| [WebserviceX](http://www.webservicex.net/ws/default.aspx) | * | * | No |
| [National Bank of Romania](http://www.bnr.ro) | RON | * | No |
| [Central Bank of the Republic of Turkey](http://www.tcmb.gov.tr) | * | TRY | No |
| [Central Bank of the Czech Republic](http://www.cnb.cz) | * | CZK | No |
| [Russian Central Bank](http://http://www.cbr.ru) | * | RUB | Yes |
| [currencylayer](https://currencylayer.com) | USD (free), * (paid) | * | Yes |
| [Cryptonator](https://www.cryptonator.com) | * Crypto (Limited standard currencies) | * Crypto (Limited standard currencies) | No |
| [1Forge](https://1forge.com) | * (free but limited or paid) | * (free but limited or paid) | No |
| [CurrencyDataFeed](https://currencydatafeed.com) | * (free but limited or paid) | * (free but limited or paid) | No |
| Array | * | * | Yes |
| [Xignite](https://www.xignite.com) | `xignite` | * | * | Yes |
| [WebserviceX](http://www.webservicex.net/ws/default.aspx) | `webservicex` | * | * | No |
| [National Bank of Romania](http://www.bnr.ro) | `national_bank_of_romania` | RON | * | No |
| [Central Bank of the Republic of Turkey](http://www.tcmb.gov.tr) | `central_bank_of_republic_turkey` | * | TRY | No |
| [Central Bank of the Czech Republic](http://www.cnb.cz) | `central_bank_of_czech_republic` | * | CZK | No |
| [Russian Central Bank](http://http://www.cbr.ru) | `russian_central_bank` | * | RUB | Yes |
| [currencylayer](https://currencylayer.com) | `currency_layer` | USD (free), * (paid) | * | Yes |
| [Cryptonator](https://www.cryptonator.com) | `cryptonator` | * Crypto (Limited standard currencies) | * Crypto (Limited standard currencies) | No |
| [1Forge](https://1forge.com) | `forge` | * (free but limited or paid) | * (free but limited or paid) | No |
| [CurrencyDataFeed](https://currencydatafeed.com) | `currency_data_feed` | * (free but limited or paid) | * (free but limited or paid) | No |
| Array | `array` | * | * | Yes |

## Integrations

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"require": {
"php": "^5.5 || ^7.0",
"florianv/exchanger": "^1.0"
"florianv/exchanger": "^1.1"
},
"require-dev": {
"phpunit/phpunit": "^4.8 || ^5.4",
Expand Down
6 changes: 3 additions & 3 deletions doc/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Let's say we want to use the [Fixer.io](http://fixer.io) service and fallback to
use Swap\Builder;

$swap = (new Builder())
->add('fixer')
->add('fixer', ['access_key' => 'your-access-key'])
->add('google')
->build();
```
Expand Down Expand Up @@ -133,7 +133,7 @@ $client = new PluginClient(new GuzzleClient(), [$cachePlugin]);

$swap = (new Builder())
->useHttpClient($client);
->add('fixer')
->add('fixer', ['access_key' => 'your-access-key'])
->build();

// A http request is sent
Expand Down Expand Up @@ -231,7 +231,7 @@ $swap = (new Builder())
->add('currency_data_feed', ['api_key' => 'secret'])
->add('currency_layer', ['access_key' => 'secret', 'enterprise' => false])
->add('european_central_bank')
->add('fixer')
->add('fixer', ['access_key' => 'your-access-key'])
->add('forge', ['api_key' => 'secret'])
->add('google')
->add('national_bank_of_romania')
Expand Down
6 changes: 3 additions & 3 deletions src/Service/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,22 @@ public static function register($name, $classOrCallable)
private function registerServices()
{
$services = [
'array' => PhpArray::class,
'central_bank_of_czech_republic' => CentralBankOfCzechRepublic::class,
'central_bank_of_republic_turkey' => CentralBankOfRepublicTurkey::class,
'currency_layer' => CurrencyLayer::class,
'currency_data_feed' => CurrencyDataFeed::class,
'cryptonator' => Cryptonator::class,
'european_central_bank' => EuropeanCentralBank::class,
'fixer' => Fixer::class,
'forge' => Forge::class,
'google' => Google::class,
'national_bank_of_romania' => NationalBankOfRomania::class,
'open_exchange_rates' => OpenExchangeRates::class,
'array' => PhpArray::class,
'russian_central_bank' => RussianCentralBank::class,
'webservicex' => WebserviceX::class,
'xignite' => Xignite::class,
'yahoo' => Yahoo::class,
'russian_central_bank' => RussianCentralBank::class,
'cryptonator' => Cryptonator::class,
];

foreach ($services as $name => $class) {
Expand Down
2 changes: 1 addition & 1 deletion tests/BuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testBuild()
$this->assertInstanceOf(Swap::class, $builder->build());

$builder = new Builder();
$builder->add('fixer');
$builder->add('fixer', ['access_key' => 'access_key']);
$builder->add('open_exchange_rates', ['app_id' => 'secret']);
$this->assertInstanceOf(Swap::class, $builder->build());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Service/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function servicesProvider()
['currency_data_feed', CurrencyDataFeed::class, ['api_key' => 'api_key']],
['currency_layer', CurrencyLayer::class, ['access_key' => 'access_key']],
['european_central_bank', EuropeanCentralBank::class],
['fixer', Fixer::class],
['fixer', Fixer::class, ['access_key' => 'access_key']],
['forge', Forge::class, ['api_key' => 'api_key']],
['google', Google::class],
['national_bank_of_romania', NationalBankOfRomania::class],
Expand Down
8 changes: 4 additions & 4 deletions tests/Service/RegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
use Exchanger\Service\NationalBankOfRomania;
use Exchanger\Service\OpenExchangeRates;
use Exchanger\Service\PhpArray;
use Exchanger\Service\RussianCentralBank;
use Exchanger\Service\WebserviceX;
use Exchanger\Service\Xignite;
use Exchanger\Service\Yahoo;
use Exchanger\Service\RussianCentralBank;
use Swap\Service\Registry;

class RegistryTest extends \PHPUnit_Framework_TestCase
Expand All @@ -45,8 +45,10 @@ public function testCoreServices($name, $class)
public function serviceProviders()
{
return [
['array', PhpArray::class],
['central_bank_of_czech_republic', CentralBankOfCzechRepublic::class],
['central_bank_of_republic_turkey', CentralBankOfRepublicTurkey::class],
['cryptonator', Cryptonator::class],
['currency_data_feed', CurrencyDataFeed::class],
['currency_layer', CurrencyLayer::class],
['european_central_bank', EuropeanCentralBank::class],
Expand All @@ -55,12 +57,10 @@ public function serviceProviders()
['google', Google::class],
['national_bank_of_romania', NationalBankOfRomania::class],
['open_exchange_rates', OpenExchangeRates::class],
['array', PhpArray::class],
['russian_central_bank', RussianCentralBank::class],
['webservicex', WebserviceX::class],
['xignite', Xignite::class],
['yahoo', Yahoo::class],
['russian_central_bank', RussianCentralBank::class],
['cryptonator', Cryptonator::class],
];
}

Expand Down

0 comments on commit 9948c8b

Please sign in to comment.