diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..f9814c5 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,17 @@ +setRules(array( + '@Symfony' => true, + '@Symfony:risky' => true, + 'array_syntax' => array('syntax' => 'short'), + 'no_unreachable_default_argument_value' => false, + 'heredoc_to_nowdoc' => false, + 'phpdoc_annotation_without_dot' => false, + )) + ->setRiskyAllowed(true) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') + ) +; diff --git a/.travis.yml b/.travis.yml index 1621da3..384db7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ php: - 5.6 - 7.0 - 7.1 - - hhvm sudo: false diff --git a/README.md b/README.md index 0a01569..2814f12 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ Here is the list of the currently implemented services. | [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 | +| Array | * | * | Yes | ## Credits diff --git a/doc/readme.md b/doc/readme.md index daf81b3..b70630d 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -233,7 +233,20 @@ Here is the complete list of supported services and their possible configuration 'google' => true, 'national_bank_of_romania' => true, 'open_exchange_rates' => ['app_id' => 'secret', 'enterprise' => false], - 'array' => [['EUR/USD' => new ExchangeRate('1.5')]], + 'array' => [ + [ + 'EUR/USD' => new ExchangeRate('1.1'), + 'EUR/GBP' => 1.5 + ], + [ + '2017-01-01' => [ + 'EUR/USD' => new ExchangeRate('1.5') + ], + '2017-01-03' => [ + 'EUR/GBP' => 1.3 + ], + ] + ], 'webservicex' => true, 'xignite' => ['token' => 'token'], 'yahoo' => true, diff --git a/src/SwapServiceProvider.php b/src/SwapServiceProvider.php index 0ea292f..1f5e83b 100644 --- a/src/SwapServiceProvider.php +++ b/src/SwapServiceProvider.php @@ -210,6 +210,6 @@ private function getServiceClass($name) */ private function getConfigPath($path = '') { - return app()->basePath() . '/config' . ($path ? '/' . $path : $path); + return app()->basePath().'/config'.($path ? '/'.$path : $path); } } diff --git a/tests/SwapServiceProviderTest.php b/tests/SwapServiceProviderTest.php index 856c71b..abadbbe 100644 --- a/tests/SwapServiceProviderTest.php +++ b/tests/SwapServiceProviderTest.php @@ -74,7 +74,7 @@ public function testAllServices() 'webservicex' => true, 'xignite' => ['token' => 'token'], 'yahoo' => true, - 'russian_central_bank' => true + 'russian_central_bank' => true, ]); $this->assertInstanceOf(Chain::class, $this->app['swap.chain']);