openfinancy/provider-component 问题修复 & 功能扩展

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

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

openfinancy/provider-component

Composer 安装命令:

composer require openfinancy/provider-component

包简介

Shared provider abstractions for OpenFinancy services.

README 文档

README

CI

Composable PHP abstractions for describing and registering OpenFinancy provider definitions. The component exposes primitives under the OpenFinancy\Component\Provider\Rate namespace that every microservice can reuse when defining external data sources.

Installation

composer require openfinancy/provider-component:^0.1

The package requires PHP 8.4+. It was designed for Symfony applications but can be integrated into any PHP project that needs structured provider definitions.

Key Features

  • Declarative provider definitions built from immutable DTOs.
  • Group/field structures that mirror complex configuration screens.
  • Registry and synchroniser interfaces for sharing provider metadata across services.
  • Compatible with Symfony Config, Doctrine, and custom storage layers.

Example

use OpenFinancy\Component\Provider\Rate\Definition\RateProviderDefinition;
use OpenFinancy\Component\Provider\Rate\Definition\RateProviderField;
use OpenFinancy\Component\Provider\Rate\Definition\RateProviderGroup;
use OpenFinancy\Component\Provider\Rate\RateProviderRegistry;

$definition = new RateProviderDefinition(
    code: 'forex',
    providerName: 'Forex API',
    description: 'External FX provider',
    providerType: 'http_api',
    country: 'US',
    website: 'https://example.com',
    apiEndpoint: 'https://example.com/api',
    metadata: ['supports_historical' => true],
    priority: 10,
    children: [
        new RateProviderGroup('connection', 'Connection', null, [
            new RateProviderField('api_key', 'API Key', 'text'),
        ]),
    ],
);

$registry = new RateProviderRegistry([$definition]);

Inject the registry into your controllers or services to list providers, supply configuration forms, or synchronise metadata to downstream systems.

Documentation

  • CHANGELOG.md – release notes and upgrade guidance.
  • Browse the tests/ directory for additional usage examples.

Quality

Before tagging a new release run:

composer test
composer analyse

These Composer scripts execute PHPUnit and static analysis to maintain a stable public surface.

Support

Open issues at https://github.com/openfinancy/provider-component/issues if you need help or want to report a problem.

License

Distributed under the European Union Public Licence v1.2 (EUPL-1.2). Refer to LICENSE for the complete text.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: EUPL-1.2
  • 更新时间: 2025-11-11