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

This package is auto-updated.

Last update: 2025-11-13 18:22:08 UTC


README

English | 中文

Latest Version PHP Version Require License Total Downloads Code Coverage

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.

References