peso/brick-rateprovider

Peso-based RateProvider class for Brick\Money

1.0.0 2025-07-22 17:28 UTC

This package is auto-updated.

Last update: 2025-07-22 17:28:54 UTC


README

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.