2017 © Pedro Peláez
 

library bryn-fallback-calculator

An exchange rate calculator that defers calculation to its registered calculators in priority order until an exchange rate is successfully returned.

image

ben-gibson/bryn-fallback-calculator

An exchange rate calculator that defers calculation to its registered calculators in priority order until an exchange rate is successfully returned.

  • Saturday, April 8, 2017
  • by ben-gibson
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Bryn - Fallback Calculator

Latest Version on Packagist ![Software License][ico-license] Build Status ![Total Downloads][ico-downloads], (*1)

A fallback calculator for Bryn that defers to registered calculators in priority order until an exchange rate is returned or they all fail., (*2)

Install

Use composer to install this library., (*3)

``` bash $ composer require ben-gibson/bryn-fallback-calculator, (*4)


## Usage ``` php <?php require 'vendor/autoload.php'; $calculator = new \Gibbo\Bryn\Calculator\Fallback\FallbackCalculator(); $calculator->registerCalculator(Gibbo\Bryn\Calculator\Yahoo\YahooCalculator::default()); $calculator->registerCalculator(Gibbo\Bryn\Calculator\ECB\ECBCalculator::default()); $exchangeRate = $calculator->getRate( new \Gibbo\Bryn\Exchange( \Gibbo\Bryn\Currency::GBP(), \Gibbo\Bryn\Currency::USD() ) ); echo $exchangeRate; echo $exchangeRate->convert(550); echo $exchangeRate->flip()->convert(550); /** * OUTPUTS: * * 1 GBP(£) = 1.25 USD($) * 686.2295 * 440.814 */

Change log

Please see CHANGELOG for more information what has changed recently., (*5)

Testing

bash $ composer test, (*6)

Contributing

Please see CONTRIBUTING for details., (*7)

Security

If you discover any security related issues, please email ben.gibson.2011@gmail.com instead of using the issue tracker., (*8)

Credits

License

The MIT License (MIT). Please see License File for more information., (*9)

The Versions

08/04 2017

dev-master

9999999-dev https://github.com/ben-gibson/bryn-fallback-calculator

An exchange rate calculator that defers calculation to its registered calculators in priority order until an exchange rate is successfully returned.

  Sources   Download

MIT

The Requires

 

The Development Requires

currency conversion exchange rate calculator fallback

08/04 2017

v0.0.2

0.0.2.0 https://github.com/ben-gibson/bryn-fallback-calculator

An exchange rate calculator that defers calculation to its registered calculators in priority order until an exchange rate is successfully returned.

  Sources   Download

MIT

The Requires

 

The Development Requires

currency conversion exchange rate calculator fallback

08/04 2017

v0.0.1

0.0.1.0 https://github.com/ben-gibson/bryn-fallback-calculator

An exchange rate calculator that defers calculation to its registered calculators in priority order until an exchange rate is successfully returned.

  Sources   Download

MIT

The Requires

 

The Development Requires

currency conversion exchange rate calculator fallback