PHPackages                             phpgears/cqrs-symfony-messenger - 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. phpgears/cqrs-symfony-messenger

ActiveLibrary

phpgears/cqrs-symfony-messenger
===============================

CQRS implementation with Symfony's Messenger

0.2.1(6y ago)13.5kMITPHPPHP ^7.1CI failing

Since Feb 3Pushed 5y ago1 watchersCompare

[ Source](https://github.com/phpgears/cqrs-symfony-messenger)[ Packagist](https://packagist.org/packages/phpgears/cqrs-symfony-messenger)[ Docs](https://github.com/phpgears/cqrs-symfony-messenger)[ RSS](/packages/phpgears-cqrs-symfony-messenger/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (16)Versions (7)Used By (0)

[![PHP version](https://camo.githubusercontent.com/d0b5687c6812c5d52d86a548e09db527eeb7860f82adbb677de00a36ddbed1b4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344372e312d3838393242462e7376673f7374796c653d666c61742d737175617265)](http://php.net)[![Latest Version](https://camo.githubusercontent.com/c4f6a71464e66bb6138568e3b1d51998790f57fa7219e2e27534c23f02db2d20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70687067656172732f637172732d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/cqrs-symfony-messenger)[![License](https://camo.githubusercontent.com/7156f904f7d0991953dce4b15928253129c6314b79a886d41176fbfa8e736f2b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70687067656172732f637172732d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpgears/cqrs-symfony-messenger/blob/master/LICENSE)

[![Build Status](https://camo.githubusercontent.com/42d09b3b80c9188259846721d3de5cd6736136fec07c6612c379efeaf07e63e6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f70687067656172732f637172732d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/github/phpgears/cqrs-symfony-messenger)[![Style Check](https://camo.githubusercontent.com/c1bea151a731b36f92c91216e520012efffd454023091d3272e226eb9f289337/68747470733a2f2f7374796c6563692e696f2f7265706f732f3136383839323138322f736869656c64)](https://styleci.io/repos/168892182)[![Code Quality](https://camo.githubusercontent.com/31b3405de41db2ad871e92f7fda19c4c28e61bcfbc5b96e944a185c2abe0da68/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f70687067656172732f637172732d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/phpgears/cqrs-symfony-messenger)[![Code Coverage](https://camo.githubusercontent.com/4d744baaf7d2ed990d39b3b9a135adc09f90a2332343c61928965e471b7978ea/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f70687067656172732f637172732d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/phpgears/cqrs-symfony-messenger)

[![Total Downloads](https://camo.githubusercontent.com/7d1fa705df51255bd53258fc2eafaeda1db336c9db4ffe3b7fe85d6512f84de8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70687067656172732f637172732d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/cqrs-symfony-messenger/stats)[![Monthly Downloads](https://camo.githubusercontent.com/8665ae5d973084a027e9317d0cc66589755e9fd9b2f35ab5398f4a5e60a7dddf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f70687067656172732f637172732d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/cqrs-symfony-messenger/stats)

CQRS with Symfony's Messenger
=============================

[](#cqrs-with-symfonys-messenger)

CQRS implementation with Symfony's Messenger

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

[](#installation)

### Composer

[](#composer)

```
composer require phpgears/cqrs-symfony-messenger

```

Usage
-----

[](#usage)

Require composer autoload file

```
require './vendor/autoload.php';
```

### Commands Bus

[](#commands-bus)

```
use Gears\CQRS\Symfony\Messenger\CommandBus;
use Gears\CQRS\Symfony\Messenger\CommandHandlerLocator;
use Symfony\Component\Messenger\MessageBus;
use Symfony\Component\Messenger\Middleware\HandleMessageMiddleware;

$commandToHandlerMap = [];

$messengerBus = new MessageBus([
    new HandleMessageMiddleware(new CommandHandlerLocator($commandToHandlerMap)),
]);

$commandBus = new CommandBus($messengerBus);

/** @var \Gears\CQRS\Command $command */
$commandBus->handle($command);
```

### Query Bus

[](#query-bus)

```
use Gears\CQRS\Symfony\Messenger\QueryBus;
use Gears\CQRS\Symfony\Messenger\QueryHandlerLocator;
use Symfony\Component\Messenger\MessageBus;
use Symfony\Component\Messenger\Middleware\HandleMessageMiddleware;

$queryToHandlerMap = [];

$messengerBus = new MessageBus([
    new HandleMessageMiddleware(new QueryHandlerLocator($queryToHandlerMap)),
]);

$queryBus = new QueryBus($messengerBus);

/** @var \Gears\CQRS\Command $query */
$result = $queryBus->handle($query);
```

Contributing
------------

[](#contributing)

Found a bug or have a feature request? [Please open a new issue](https://github.com/phpgears/cqrs-symfony-messenger/issues). Have a look at existing issues before.

See file [CONTRIBUTING.md](https://github.com/phpgears/cqrs-symfony-messenger/blob/master/CONTRIBUTING.md)

License
-------

[](#license)

See file [LICENSE](https://github.com/phpgears/cqrs-symfony-messenger/blob/master/LICENSE) included with the source code for a copy of the license terms.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.1% 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 ~61 days

Total

5

Last Release

2411d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c50421f1ab4148354dc2dd5dcaba168656b17ea913b310d112deb39a6f73ca1?d=identicon)[juliangut](/maintainers/juliangut)

---

Top Contributors

[![juliangut](https://avatars.githubusercontent.com/u/1104131?v=4)](https://github.com/juliangut "juliangut (16 commits)")[![yuripave](https://avatars.githubusercontent.com/u/315831?v=4)](https://github.com/yuripave "yuripave (1 commits)")

---

Tags

symfonyquerycommandimmutableMessengercqrs

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpgears-cqrs-symfony-messenger/health.svg)

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

PHPackages © 2026

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