integration-kit/bundle
Composer 安装命令:
composer require integration-kit/bundle
包简介
Standardize external API consumption in Symfony
README 文档
README
Standardize external API consumption in Symfony, without reinventing the wheel.
Value Proposition
This bundle provides a minimal abstraction layer to standardize external API calls (Stripe, Slack, CRM, webhooks...) in Symfony business code. It relies on HttpClient, EventDispatcher and Messenger without replacing them, and ensures that each integration is testable, traceable and normalized.
Key points:
- The bundle does not impose any business model and does not encapsulate HttpClient
- Each integration uses HttpClient directly and exposes typed business methods
- Execution goes through typed Command objects (no magic strings, no dynamic reflection)
Target Audience
For:
- Teams that multiply external integrations (3+ different APIs)
- Projects where API call traceability is critical (logs, metrics, errors)
- Codebases where you want to avoid HTTP code duplication (retries, timeouts, authentication)
- Teams that want to test integrations without real HTTP calls
NOT for:
- Projects with a single external integration (unnecessary overhead)
- Teams that prefer total control over each HTTP call
- Projects where each API requires very specific HTTP logic
- Applications that don't need standardized traceability
Usage Example (30 lines)
// 1. Define a typed Command (execution contract) final class SlackNotifyCommand implements IntegrationCommand { public function __construct( public readonly string $email, public readonly string $name ) {} public function integrationName(): string { return 'slack'; } } // 2. Define an explicit Handler (typed mapping, no reflection) final class SlackNotifyHandler implements IntegrationHandlerInterface { public function __construct( private HttpClientInterface $httpClient, private string $webhookUrl ) {} public function supports(): string { return SlackNotifyCommand::class; } public function handle(IntegrationCommand $command): void { assert($command instanceof SlackNotifyCommand); $response = $this->httpClient->request('POST', $this->webhookUrl, [ 'json' => ['text' => "User {$command->email} ({$command->name}) registered"] ]); if (200 !== $response->getStatusCode()) { throw new IntegrationException('slack', 'Notification failed'); } } } // 3. Use it in business code (strong typing, auto-completion) class UserService { public function __construct( private IntegrationExecutor $executor ) {} public function notifyUserRegistered(User $user): void { // Typed command = compile-time safety, refactoring safe $this->executor->execute(new SlackNotifyCommand( $user->getEmail(), $user->getName() )); } }
Installation
composer require integration-kit/bundle
Configuration
The bundle works without YAML configuration. Just register your integrations and handlers:
# config/services.yaml services: App\Integration\SlackIntegration: tags: - { name: 'integration_kit.integration', name: 'slack' } App\Integration\SlackNotifyHandler: arguments: $webhookUrl: '%env(SLACK_WEBHOOK_URL)%' tags: - { name: 'integration_kit.handler', command: 'App\Integration\SlackNotifyCommand' }
Complete Documentation
See README.fr.md for complete documentation in French, or EXEMPLE_USAGE.md for a comprehensive usage guide with examples.
License
MIT
integration-kit/bundle 适用场景与选型建议
integration-kit/bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「api」 「bundle」 「integration」 「http-client」 「integration-kit」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 integration-kit/bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 integration-kit/bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 integration-kit/bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
2lenet/EasyAdminPlusBundle
The bundle for easy using json-rpc api on your project
Provide a way to secure accesses to all routes of an symfony application.
DMS Meetup API Bundle, enables Meetup API clients in services
A PSR-7 compatible library for making CRUD API endpoints
Bundle Symfony DaplosBundle
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-22