onliner/command-bus 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

onliner/command-bus

最新稳定版本:v1.1.7

Composer 安装命令:

composer require onliner/command-bus

包简介

PHP easy to use command bus.

README 文档

README

This is easy to use PHP command bus implementation.

Version Total Downloads Php License Build Status

Installation

The preferred way to install this extension is through composer.

Either run

composer require onliner/command-bus:^0.1.0

or add this code line to the require section of your composer.json file:

"onliner/command-bus": "^0.1.0"

Usage

use Onliner\CommandBus\Builder;

class Hello
{
    public $message;

    public function __construct(string $message)
    {
        $this->message = $message;
    }
}

$dispatcher = (new Builder())
    ->handle(Hello::class, function (Hello $command) {
        echo 'Hello ' . $command->message;
    })
    ->build();

$dispatcher->dispatch(new Hello('onliner'));

More examples can be found here.

License

Released under the MIT license.

统计信息

  • 总下载量: 21.02k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 2
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 8
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-29