ben-gibson / bryn-yahoo-calculator
An exchange rate calculator that pulls data from Yahoo's YQL Finance API.
Installs: 9
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ben-gibson/bryn-yahoo-calculator
Requires
- php: ~7.0
- ben-gibson/bryn: ~0.0.1
- php-http/client-common: ^1.4
- php-http/client-implementation: ^1.0
- php-http/discovery: ^1.2
- php-http/httplug: ^1.1
Requires (Dev)
- php-http/guzzle6-adapter: ^1.1
- php-http/mock-client: ^1.0
- phpunit/phpunit: ~6.0
- squizlabs/php_codesniffer: ~2.3
This package is not auto-updated.
Last update: 2025-10-26 07:14:57 UTC
README
An exchange rate calculator for Bryn that pulls data from Yahoo's YQL Finance API. HTTPlug
is used to support multiple HTTP clients including Guzzle, Buzz, and Curl.
Install
Use composer to install this library and your preferred HTTP client.
$ composer require php-http/guzzle6-adapter $ composer require ben-gibson/bryn-yahoo-calculator
Usage
<?php require 'vendor/autoload.php'; $calculator = \Gibbo\Bryn\Calculator\Yahoo\YahooCalculator::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.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email ben.gibson.2011@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.