PHPackages                             helthe/cqrs - 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. helthe/cqrs

ActiveLibrary

helthe/cqrs
===========

Helthe CQRS Component

351PHP

Since Sep 16Pushed 11y ago1 watchersCompare

[ Source](https://github.com/helthe/CQRS)[ Packagist](https://packagist.org/packages/helthe/cqrs)[ RSS](/packages/helthe-cqrs/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Helthe CQRS [![Build Status](https://camo.githubusercontent.com/3dc9065a16144a2ecc7d6b68d23816f4d233f3553d8e2c4f873e64da580e7220/68747470733a2f2f7472617669732d63692e6f72672f68656c7468652f435152532e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/helthe/CQRS) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/2c85a90d76b081b60f08b585c7dd4d517ca552723ef52309ef2403b568c1edaa/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68656c7468652f435152532f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/helthe/CQRS/?branch=master)
=============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#helthe-cqrs--)

Helthe CQRS is a small library implementing [command-query separation](http://en.wikipedia.org/wiki/Command%E2%80%93query_separation). It's based on the refactored version of [LiteCQRS](https://github.com/beberlei/litecqrs-php) and the work of [Mark Nijhof](https://github.com/MarkNijhof/Fohjin)for his [CQRS book](https://leanpub.com/cqrs).

Currently, the library only implements command handling using a command bus for communication.

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

[](#installation)

### Using Composer

[](#using-composer)

#### Manually

[](#manually)

Add the following in your `composer.json`:

```
{
    "require": {
        // ...
        "helthe/cqrs": "dev-master"
    }
}
```

#### Using the command line

[](#using-the-command-line)

```
$ composer require 'helthe/cqrs=dev-master'
```

Usage
-----

[](#usage)

The component contains mainly helper interfaces for implementing CQRS. Some basic implementations are also included.

```
use Helthe\Component\CQRS\Bus\SequentialCommandBus;
use Helthe\Component\CQRS\Command\CommandInterface;
use Helthe\Component\CQRS\CommandHandler\CommandHandlerInterface;
use Helthe\Component\CQRS\CommandHandler\MemoryCommandHandlerLocator;

/* @var CommandInterface */
$command = new Command()
/* @var CommandHandlerInterface */
$handler = new CommandHandler()

$locator = new MemoryCommandHandlerLocator();
$locator->register(get_class($command), $handler);

$bus = new SequentialCommandBus($locator);

$bus->dispatch($command);
```

Bugs
----

[](#bugs)

For bugs or feature requests, please [create an issue](https://github.com/helthe/CQRS/issues/new).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9dc50dba9cc5e4bf097f44026034daa66e2ed552549ba363304ff22914f4c0d1?d=identicon)[carlalexander](/maintainers/carlalexander)

---

Top Contributors

[![carlalexander](https://avatars.githubusercontent.com/u/654684?v=4)](https://github.com/carlalexander "carlalexander (6 commits)")

### Embed Badge

![Health badge](/badges/helthe-cqrs/health.svg)

```
[![Health](https://phpackages.com/badges/helthe-cqrs/health.svg)](https://phpackages.com/packages/helthe-cqrs)
```

PHPackages © 2026

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