Skip to content

Commit

Permalink
Merge pull request #28 from mortola/feature/currency-converter-api-co…
Browse files Browse the repository at this point in the history
…nfiguration

Add Currency Converter API configuration
  • Loading branch information
florianv authored Jul 29, 2019
2 parents cd1544d + 42216b6 commit 23316f1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ public function getConfigTreeBuilder()
->end()
->end()
->end()
->arrayNode('currency_converter')
->children()
->integerNode('priority')->defaultValue(0)->end()
->scalarNode('access_key')
->treatFalseLike(null)
->treatTrueLike(null)
->isRequired()
->cannotBeEmpty()
->end()
->booleanNode('enterprise')->defaultFalse()->end()
->end()
->end()
->arrayNode('array')
->children()
->integerNode('priority')->defaultValue(0)->end()
Expand Down
3 changes: 3 additions & 0 deletions Resources/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ florianv_swap:
enterprise: true
xignite: # Xignite
token: secret
currency_converter: # Currency Converter API
access_key: secret
enterprise: true
array:
rates:
'EUR/GBP': 1.5
Expand Down
2 changes: 2 additions & 0 deletions Tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public function provideValidProvidersConfigs()
[['open_exchange_rates' => ['app_id' => 'any']]],
[['xignite' => ['token' => 'any']]],
[['xignite' => ['token' => 'any'], 'currency_layer' => ['access_key' => 'any']]],
[['currency_converter' => ['access_key' => 'any']]],
[[
'array' => [
'rates' => [
Expand Down Expand Up @@ -170,6 +171,7 @@ public function provideInvalidProvidersConfigs()
[['forge' => []]],
[['open_exchange_rates' => ['app_id' => true]]],
[['xignite' => ['token' => []]]],
[['currency_converter' => ['access_key' => null]]],
[['array' => null]],
[['array' => []]],
[['array' => ['EUR/GBP' => 1.5]]],
Expand Down

0 comments on commit 23316f1

Please sign in to comment.