PHPackages                             ashleydawson/command-bus - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. ashleydawson/command-bus

ActiveLibrary[CLI &amp; Console](/categories/cli)

ashleydawson/command-bus
========================

Command bus and executable commands with a return/response

1.0.0(9y ago)018MITPHPPHP &gt;=5.5

Since Jan 2Pushed 9y ago1 watchersCompare

[ Source](https://github.com/AshleyDawson/CommandBus)[ Packagist](https://packagist.org/packages/ashleydawson/command-bus)[ RSS](/packages/ashleydawson-command-bus/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Command Bus
===========

[](#command-bus)

[![Build Status](https://camo.githubusercontent.com/023ca1a14709a6029c0ec4372f9b5c8130739444a905ee55c76678856f0c32d8/68747470733a2f2f7472617669732d63692e6f72672f4173686c6579446177736f6e2f436f6d6d616e644275732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/AshleyDawson/CommandBus)

Super-simple command bus implementation that allows return types. Each command has a **single**, designated handler.

**Note:** Depending on your architecture - it might not be appropriate for commands to return a response. Typically, in [CQS](https://en.wikipedia.org/wiki/Command%E2%80%93query_separation) architecture, state change is observed/measured via events or queries.

Installation
------------

[](#installation)

Install the command bus library via [Composer](https://getcomposer.org):

```
$ composer require ashleydawson/command-bus

```

Basic Usage
-----------

[](#basic-usage)

To use the command bus, start by adding a command:

```
