gawrys / counterparty-bundle
Symfony bundle for counterparty-verification: DI extension, tagged drivers and research tools, validator constraint and Messenger integration.
Package info
github.com/igorgawrys1/counterparty-bundle
Type:symfony-bundle
pkg:composer/gawrys/counterparty-bundle
Requires
- php: >=8.2
- gawrys/counterparty-core: ^0.1
- symfony/config: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
- symfony/http-client: ^6.4 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
- symfony/messenger: ^6.4 || ^7.0
- symfony/validator: ^6.4 || ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- gawrys/counterparty-ai: ^0.1
- nyholm/psr7: ^1.8
- php-http/discovery: ^1.19
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^11.0
- psalm/plugin-phpunit: ^0.19
- psalm/plugin-symfony: ^5.0
- vimeo/psalm: ^6.0
Suggests
- gawrys/counterparty-ai: Enables AI-assisted advisory risk research (strategy: ai).
README
The Symfony bundle for the Counterparty Verification toolkit: a DI extension, tagged drivers and research tools, a validator constraint and Messenger integration.
⚠️ A due-diligence aid, not a guarantee of AML compliance. Risk output is advisory.
Features
- Auto-wired - PSR contracts mapped onto Symfony (
Psr18Client, logger, clock); theVerifieris a first-class service. - Tagged drivers - tag a service
counterparty.registry_driverand a compiler pass collects it into the shared manager (research tools viacounterparty.research_tool). - Validator - a
NotSanctionedconstraint + validator for the Validator component. - Messenger - a message + handler for asynchronous verification.
- Config-driven - strategy (
rule_based|ai), sanctions provider, registry tokens; conditional AI wiring.
Installation
composer require gawrys/counterparty-bundle
# config/packages/counterparty.yaml counterparty: strategy: rule_based # or "ai" (requires gawrys/counterparty-ai + an AiResearchProvider) sanctions: provider: sanctions_network # or "opensanctions" registries: ceidg_token: '%env(CEIDG_TOKEN)%'
Usage
public function __construct(private \Gawrys\Counterparty\Verifier $verifier) {} $outcome = $this->verifier->verify(new \Gawrys\Counterparty\Counterparty('Acme', 'PL', nip: '1234567890'));
Add a registry by tagging a service:
services: App\Registry\GermanRegistryDriver: tags: - { name: counterparty.registry_driver, alias: de }
Validate a property:
use Gawrys\Counterparty\Symfony\Validator\NotSanctioned; #[NotSanctioned(country: 'PL')] private string $counterpartyName;
Async via Messenger: dispatch VerifyCounterpartyMessage; VerifyCounterpartyHandler handles it.
Full guide: documentation.
Testing
composer check # php-cs-fixer + PHPStan max (phpstan-symfony) + Psalm level 1 + PHPUnit
Changelog
See CHANGELOG.md.
Contributing & Security
Pull requests welcome. Report security issues privately - see SECURITY.md.
Credits
License
The MIT License (MIT). See LICENSE.