PHPackages                             php-ddd/command - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. php-ddd/command

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

php-ddd/command
===============

The command part of the Command Query Responsibility Segregation

v1.0.2(11y ago)75.6k12MITPHPPHP &gt;=5.3.3

Since Nov 15Pushed 10y ago1 watchersCompare

[ Source](https://github.com/php-ddd/command)[ Packagist](https://packagist.org/packages/php-ddd/command)[ RSS](/packages/php-ddd-command/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (5)Used By (2)

Command [![Build Status](https://camo.githubusercontent.com/07c25ca084069c9edb485570518fc4e2ce6ece003d8a1276379b5a6f7edb8e5f/68747470733a2f2f7472617669732d63692e6f72672f7068702d6464642f636f6d6d616e642e737667)](https://travis-ci.org/php-ddd/command) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/157d29767a4c5b565d6fb8eff6e40d5dd8c6605c1223d1f5ec9a56e217c8b98c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068702d6464642f636f6d6d616e642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/php-ddd/command/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/9937407719f8815f547008396b9891b883d97fdf778f59652404c405b4e50b18/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068702d6464642f636f6d6d616e642f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/php-ddd/command/?branch=master) [![SensioLabsInsight](https://camo.githubusercontent.com/0e1353a37376f707d84c83a650d647dc0b7a73ec53195c5240ec344d18bb75d9/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f39393330353164632d323830662d346338322d393161342d3165396263663661313263342f6d696e692e706e67)](https://insight.sensiolabs.com/projects/993051dc-280f-4c82-91a4-1e9bcf6a12c4)
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#command----)

This library provides some useful tools in order to create a simple command system.

How it works
------------

[](#how-it-works)

```
// configuration
$handler = new AddItemToChartCommandHandler();
$locator = new CommandHandlerLocator();
$locator->register('AddItemToChartCommand', $handler);

$bus = new SequentialCommandBus($locator);

// usage
$command = new AddItemToChartCommand($item, $chart);
$bus->dispatch($command); // internally, the bus will call the corresponding handler.
```

Conventions
-----------

[](#conventions)

We want to follow the Single Responsibility principle. Hence:

- A `CommandHandler` can only handle one `CommandInterface`
- A `CommandBus` will only dispatch some `CommandInterface` (and nothing more)
- A `CommandHandlerLocator` is responsible of registering associations between `Command` and `CommandHandler`

It allows us to force some other conventions like the name of the `CommandHandler` class that needs to match the name of the `Command` it handle. E.g: `AddItemToChartCommand` will be handled by a `AddItemToChartCommandHandler` object.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Total

4

Last Release

4201d ago

Major Versions

v0.1.0 → v1.0.02014-12-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/5cc2f661073d68100db53e02e0892a69076f0b44bc0ced487b043c6aff28ad0c?d=identicon)[JulienDufresne](/maintainers/JulienDufresne)

---

Top Contributors

[![juliendufresne](https://avatars.githubusercontent.com/u/1397529?v=4)](https://github.com/juliendufresne "juliendufresne (2 commits)")[![dbuton](https://avatars.githubusercontent.com/u/8166586?v=4)](https://github.com/dbuton "dbuton (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/php-ddd-command/health.svg)

```
[![Health](https://phpackages.com/badges/php-ddd-command/health.svg)](https://phpackages.com/packages/php-ddd-command)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
