定制 matthis/chief 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

matthis/chief

最新稳定版本:v1.4.0

Composer 安装命令:

composer require matthis/chief

包简介

A simple command bus

README 文档

README

Build Status

A simple Command bus.

Installation

Install via composer.

composer require "matthis/chief:1.2.*"

Usage

Executing a command is as simple as:

<?php 

$commandBus = new matthis\Chief\CommandBus();

$myCommand = new RegisterUserCommand('John Doe', 'john@doe.com');
$commandBus->execute($myCommand);

Chief expects the following naming convention:

The commands should end with "Command".

Example command:

<?php

class RegisterUserCommand
    public function __construct($username, $email)
    {
        $this->username = $username;
        $this->email = $email;
    }
}

For Chief to map the command to a command handler the handler should have the same name as the command and have "Handler" appended to it.

Example command handler:

<?php

class RegisterUserCommandHandler
{
    public function handle($command)
    {
        $command->username; //John Doe
        $command->email; //john@doe.com
    }
}

Tests

vendor/bin/phpspec run

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固