Skip to content

phpeso/brick-rateprovider

Repository files navigation

Peso-based RateProvider class for Brick\Money

Packagist PHP License GitHub Actions Codecov

This is a library that provides a RateProvider class for the Brick\Money based on the Peso for PHP.

Installation

composer require peso/brick-rateprovider

Example

<?php

use Brick\Money\CurrencyConverter;
use Brick\Money\Money;
use Peso\Brick\PesoRateProvider;
use Peso\Services\EuropeanCentralBankService;

require __DIR__ . '/vendor/autoload.php';

$rateProvider = new PesoRateProvider(new EuropeanCentralBankService());
$converter = new CurrencyConverter($rateProvider);

$eur100 = Money::of(100.00, 'EUR');

echo $converter->convert($eur100, 'USD'), PHP_EOL; // 'USD ...'

Documentation

Read the full documentation here: https://phpeso.org/v1.x/integrations/brick-rateprovider.html

Support

Please file issues on our main repo at GitHub: https://github.com/phpeso/brick-rateprovider/issues

License

The library is available as open source under the terms of the MIT License.

About

Peso-based RateProvider class for Brick\Money

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages