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

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

pauci/cqrs-factory
==================

CQRS factories for PSR-11

v0.7.0(3y ago)122.2k4MITPHPPHP ^8.0 || ^8.1 || ^8.2CI failing

Since Mar 2Pushed 3y ago2 watchersCompare

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

READMEChangelog (10)Dependencies (8)Versions (22)Used By (0)

CQRS factories
==============

[](#cqrs-factories)

[![Source Code](https://camo.githubusercontent.com/f63d4bf915e2613e4f1c4eed3106d08518f871136f1ed071d7c1750b8b5f5a01/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d70617563692f637172732d2d666163746f72792d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/pauci/cqrs-factory)[![Latest Version](https://camo.githubusercontent.com/3bc18b6605a61bfb24b8775591d068e899f577c5156a5b525e5d90dd4623ccb7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70617563692f637172732d666163746f72792e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://packagist.org/packages/pauci/cqrs-factory)[![Build Status](https://camo.githubusercontent.com/3b228a3d5e27ed7b6daafcaeb28ed12e0ed46b45a99c48f0c8de260237cd0897/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f70617563692f637172732d666163746f72792f436f6e74696e756f7573253230496e746567726174696f6e3f7374796c653d666c61742d737175617265)](https://github.com/pauci/cqrs-factory/actions?query=workflow%3A%22Continuous+Integration%22)[![Coverage Status](https://camo.githubusercontent.com/160a46a74befb59ca8acebb5925bedd485df85c6b5630b0584c1667e065f80a3/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f70617563692f637172732d666163746f72793f7374796c653d666c61742d737175617265)](https://codecov.io/gh/pauci/cqrs-factory)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/pauci/cqrs-factory/blob/master/LICENSE)[![Total Downloads](https://camo.githubusercontent.com/292ed28ee7e6ade3acf69b4b2f055100da65c0b87e7c9e9581db2efa7b156e2e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70617563692f637172732d666163746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pauci/cqrs-factory)

[CQRS](https://github.com/pauci/cqrs) factories for PSR-11

This package provides a set of factories to be used with containers using the PSR-11 standard for an easy CQRS integration in a project.

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

[](#installation)

The easiest way to install this package is through composer:

```
$ composer require pauci/cqrs-factory
```

Configuration
-------------

[](#configuration)

In the general case where you are only using a single command bus, it's enough to define the command bus factory:

```
return [
    'dependencies' => [
        'factories' => [
            'cqrs.command_bus.cqrs_default' => \CQRSFactory\CommandBusFactory::class,
        ],
    ],
];
```

If you want to add a second command bus, or use another name than "cqrs\_default", you can do so by using the static variants of the factories:

```
return [
    'dependencies' => [
        'factories' => [
            'cqrs.command_bus.cqrs_other' => [\CQRSFactory\CommandBusFactory::class, 'cqrs_other'],
        ],
    ],
];
```

Each factory supplied by this package will by default look for a registered factory in the container. If it cannot find one, it will automatically pull its dependencies from on-the-fly created factories. This saves you the hassle of registering factories in your container which you may not need at all. Of course, you can always register those factories when required. The following additional factories are available:

- `\CQRSFactory\EventBusFactory` (cqrs.event\_bus.\*)
- `\CQRSFactory\EventPublisherFactory` (cqrs.event\_publisher.\*)
- `\CQRSFactory\EventStoreFactory` (cqrs.event\_store.\*)
- `\CQRSFactory\IdentityMapFactory` (cqrs.identity\_map.\*)
- `\CQRSFactory\SerializerFactory` (cqrs.serializer.\*)
- `\CQRSFactory\TransactionManagerFactory` (cqrs.transaction\_manager.\*)

Each of those factories supports the same static behavior as the command bus factory. For container specific configurations, there are a few examples provided in the example directory:

- [Zend\\ServiceManager](example/zend-servicemanager.php)

Example configuration
---------------------

[](#example-configuration)

A complete example configuration can be found in [example/config.php](example/config.php).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 93% 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 ~157 days

Recently: every ~193 days

Total

17

Last Release

1259d ago

PHP version history (6 changes)0.1.0PHP ^5.6 || ^7.0

v0.2.1PHP ^7.0

v0.4.0PHP ^7.1

v0.5.0PHP ^7.4 | ^8.0

v0.6.0PHP ~8.0.0||~8.1.0

v0.7.0PHP ^8.0 || ^8.1 || ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2421146?v=4)[Pavol Kirschbaum](/maintainers/pauci)[@pauci](https://github.com/pauci)

---

Top Contributors

[![pauci](https://avatars.githubusercontent.com/u/2421146?v=4)](https://github.com/pauci "pauci (40 commits)")[![lukasblaho](https://avatars.githubusercontent.com/u/8330355?v=4)](https://github.com/lukasblaho "lukasblaho (3 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k447.1M9.1k](/packages/symfony-dependency-injection)[illuminate/contracts

The Illuminate Contracts package.

706127.7M12.7k](/packages/illuminate-contracts)[illuminate/container

The Illuminate Container package.

31180.7M2.3k](/packages/illuminate-container)[symfony/type-info

Extracts PHP types information.

20062.9M227](/packages/symfony-type-info)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

562565.8k42](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751284.3k37](/packages/civicrm-civicrm-core)

PHPackages © 2026

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