Skip to content

OpenFinancy/provider-component

Repository files navigation

OpenFinancy Provider Component

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages