redcode/currency-rate 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

redcode/currency-rate

最新稳定版本:0.2.4

Composer 安装命令:

composer require redcode/currency-rate

包简介

Useful library for fetching currency rates from cbr and ecb providers

README 文档

README

Build Status Code Coverage Scrutinizer Code Quality SensioLabsInsight Dependency Status

This library shows an efficient way to work with currencies and currency rates form Central Bank of Russia, European Central Bank, and Yahoo Finance. It contains base classes and interfaces which hide logic about loading currency rates, one of the most useful implementation is Symfony2 bundle.

Installing

Composer

You can easily install it with composer by command:

composer require redcode/currency-rate

Documentation

First of all you need to implement services ICurrencyRateManager, ICurrencyManager. Then DTO or Entity objects Currency and CurrencyRate.

After that create and configure currencyConverter:

use RedCode\Currency\Rate;

// we have initialized $currencyRateManager and $currencyManager

$providerFactory = new Provider\ProviderFactory();
$providerFactory->addProvider(
  new Provider\EcbCurrencyRateProvider`(
    $currencyRateManager, 
    $currencyManager
  )
);

$converter = new CurrencyConverter(
  $providerFactory, 
  $currencyRateManager, 
  $currencyManager
);

$convertedValue = $converter->convert('USD', 'GBP', 100);

Tests

To run tests use command below:

./tests/runTests.sh

Contribute

Pull requests are welcome. Please see our CONTRIBUTING guide.

统计信息

  • 总下载量: 463.66k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 5
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固