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.
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.
- 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.
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.
CHANGELOG.md– release notes and upgrade guidance.- Browse the
tests/directory for additional usage examples.
Before tagging a new release run:
composer test
composer analyse
These Composer scripts execute PHPUnit and static analysis to maintain a stable public surface.
Open issues at https://github.com/openfinancy/provider-component/issues if you need help or want to report a problem.
Distributed under the European Union Public Licence v1.2 (EUPL-1.2). Refer to LICENSE for the complete text.