tourze / wechat-work-mini-program-bundle
A Symfony Bundle for WeChat Work Mini Program integration
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
pkg:composer/tourze/wechat-work-mini-program-bundle
Requires
- doctrine/doctrine-bundle: ^2.13
- symfony/config: ^7.3
- symfony/console: ^7.3
- symfony/dependency-injection: ^7.3
- symfony/doctrine-bridge: ^7.3
- symfony/event-dispatcher-contracts: ^3
- symfony/framework-bundle: ^7.3
- symfony/http-kernel: ^7.3
- symfony/property-access: ^7.3
- symfony/yaml: ^7.3
- tourze/bundle-dependency: 1.*
- tourze/symfony-dependency-service-loader: 1.0.*
- tourze/wechat-work-bundle: 1.0.*
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
- symfony/phpunit-bridge: ^7.3
- tourze/phpunit-symfony-kernel-test: 1.0.*
- tourze/phpunit-symfony-unit-test: 1.*
This package is auto-updated.
Last update: 2025-11-13 18:22:08 UTC
README
A Symfony Bundle for WeChat Work Mini Program integration. This bundle provides tools and event system for managing WeChat Work Mini Program authentication and user interactions.
Requirements
- PHP 8.1 or higher
- Symfony 7.3 or higher
Installation
composer require tourze/wechat-work-mini-program-bundle
Quick Start
1. Register Bundle
Add the bundle to config/bundles.php:
return [ // ... WechatWorkMiniProgramBundle\WechatWorkMiniProgramBundle::class => ['all' => true], ];
2. Basic Usage
<?php use WechatWorkMiniProgramBundle\Event\CodeToSessionEvent; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; // Dispatch code to session event $event = new CodeToSessionEvent(); $dispatcher->dispatch($event);
Features
- Code2Session Integration: Handle WeChat Work Mini Program authentication flow
- Event System: Built-in event dispatcher for handling authentication events
- Console Commands: Testing and debugging commands
- Symfony Integration: Seamless integration with Symfony applications
- PHP 8.1+ Support: Modern PHP features and strict typing
- Test Coverage: Comprehensive test suite with PHPUnit
API Reference
Events
CodeToSessionEvent
use WechatWorkMiniProgramBundle\Event\CodeToSessionEvent; // Basic event for handling WeChat Work Mini Program authentication $event = new CodeToSessionEvent();
Note: This event class is currently minimal and may be extended in future versions with methods for handling authentication parameters and response data.
Commands
Test Command
php bin/console wechat-work:test
This command is used for testing the bundle functionality and verifying proper installation.
Development
Running Tests
# Run all tests ./vendor/bin/phpunit packages/wechat-work-mini-program-bundle/tests # Run with coverage ./vendor/bin/phpunit packages/wechat-work-mini-program-bundle/tests --coverage-text
Code Quality
# PHPStan analysis
php -d memory_limit=2G ./vendor/bin/phpstan analyse packages/wechat-work-mini-program-bundle
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
The MIT License (MIT). Please see License File for more information.