halloverden / symfony-brreg-http-client
Provides a Symfony http client for the brreg (Brønnøysundregistrene) api
Installs: 838
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
pkg:composer/halloverden/symfony-brreg-http-client
Requires
- php: >=8.4
- jms/serializer-bundle: ^5.0
- symfony/http-client: ^6.4|^7.2
Requires (Dev)
- phpunit/phpunit: ^12.0
README
Symfony Http Client for the Open Brreg REST Api for the Organization Registry.
Installation
Via composer:
$ composer require halloverden/symfony-brreg-http-client
Usage
In your services.yaml
, set
HalloVerden\BrregHttpClient\BrregEntityClientInterface: class: HalloVerden\BrregHttpClient\BrregEntityClient
In your class, inject the BrregEntityClientInterface
interface:
readonly final class TestService {
public function __construct(private BrregEntityClientInterface $client) {
}
public function test(string $organizationNumber): BrregEntity {
return $this->client->fetchEntityByOrganizationNumber($organizationNumber);
}
}
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.