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

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

pccomponentes/common-bus
========================

Common bus library

v0.0.2(7y ago)013MITPHPPHP ^7.2

Since Sep 17Pushed 7y ago2 watchersCompare

[ Source](https://github.com/PcComponentes/common-bus)[ Packagist](https://packagist.org/packages/pccomponentes/common-bus)[ RSS](/packages/pccomponentes-common-bus/feed)WikiDiscussions master Synced yesterday

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

Common bus
==========

[](#common-bus)

Bus
===

[](#bus)

You can create your own bus implementing CommandBus or QueryBus Interface, or you can use the pre-configured Bus CommandBusSync for Commands or QueryBusSync for Queries

Using Buses
===========

[](#using-buses)

```
$bus = new CommandBusSync();
$bus->register(YourCommandClass::class, new Your\Invokable\Handler());
$bus->dispatch(new YourCommandClass());
```

If you use a Service Container like Symfony Dependency Injection you can configure your bus registering your commands:

```
unilae.bus.sync-command:
    class: Unilae\HexagonalUtils\Infrastructure\Bus\Command\CommandBusSync
    calls:
      - method: register
        arguments:
         - 'Your\Command\Class\Name'
         - '@Your\Handler\Service\Id'
```

With this, you can inject the bus to your controller:

```
final class MyController
{
    private $bus;

    public function __construct(CommandBusSync $bus)
    {
        $this->bus = $bus;
    }

    public function __invoke(Request $request)
    {
        $this->bus->dispatch(
            new Your\Command\Class(
                new Uuid($request->get('request_id'))
            )
        );
    }
}
```

If you register more than one command to the same bus, i suggest you to install and use `ocramius/proxy-manager` for proxy handlers.

Using Middlewares
=================

[](#using-middlewares)

The pre-configured command bus supports Middleware chain, for use you can pass your Middleware classes to your Bus constructor

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2795d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c4eb3322c15a9344e9c086a7de11c3204bf5aab5321b562bf9193f5ee8cd420?d=identicon)[zoilomora](/maintainers/zoilomora)

---

Top Contributors

[![AaronBernabeu](https://avatars.githubusercontent.com/u/3294776?v=4)](https://github.com/AaronBernabeu "AaronBernabeu (8 commits)")

### Embed Badge

![Health badge](/badges/pccomponentes-common-bus/health.svg)

```
[![Health](https://phpackages.com/badges/pccomponentes-common-bus/health.svg)](https://phpackages.com/packages/pccomponentes-common-bus)
```

PHPackages © 2026

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