PHPackages                             mmalessa/command-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. mmalessa/command-bus

ActiveLibrary

mmalessa/command-bus
====================

Simple library to implement command bus.

v1.2(6y ago)0251MITPHPPHP &gt;=7.2

Since Aug 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mmalessa/command-bus)[ Packagist](https://packagist.org/packages/mmalessa/command-bus)[ Docs](https://github.com/mmalessa/command-bus)[ RSS](/packages/mmalessa-command-bus/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)DependenciesVersions (4)Used By (1)

Command bus
===========

[](#command-bus)

Implementation of a simple command bus.

Use it at your own risk.

Install
=======

[](#install)

```
composer req mmalessa/command-bus
```

Example of use
==============

[](#example-of-use)

```
class ExampleCommand
{
    private $id;
    private $name;

    public function __construct(int $id, string $name)
    {
        $this->id = $id;
        $this->name = $name;
    }

    public function getId()
    {
        return $this->id;
    }

    public function getName()
    {
        return $this->name;
    }
}
```

```
class ExampleCommandHandler
{
    public function handle(ExampleCommand $command)
    {
        echo "Example command handler" . PHP_EOL;
        printf("ID: %s\n", $command->getId());
        printf("Name: %s\n", $command->getName());
    }
}
```

```
use Mmalessa\CommandBus\CommandBus;

$commandBus = new CommandBus();
$commandBus->subscribe(new ExampleCommandHandler());
// The command class is automatically detected based on the type of parameter
// in the handler 'handle' method.

$command = ExampleCommand::create(1, "Silifon");
$commandBus->handle($command);
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

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 ~4 days

Total

3

Last Release

2448d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/002ff67dd90c9245daea55d065039f10790fd1c46d1b016ad120b761da294b8f?d=identicon)[mmalessa](/maintainers/mmalessa)

---

Top Contributors

[![mmalessa](https://avatars.githubusercontent.com/u/3789506?v=4)](https://github.com/mmalessa "mmalessa (14 commits)")

---

Tags

command bus

### Embed Badge

![Health badge](/badges/mmalessa-command-bus/health.svg)

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

###  Alternatives

[league/tactician

A small, flexible command bus. Handy for building service layers.

86415.4M127](/packages/league-tactician)[simple-bus/message-bus

Generic classes and interfaces for messages and message buses

3455.7M30](/packages/simple-bus-message-bus)[simple-bus/symfony-bridge

Bridge for using command buses and event buses in Symfony projects

1314.3M19](/packages/simple-bus-symfony-bridge)[league/tactician-doctrine

Plugins for Tactician commands using Doctrine, like wrapping every command in a transaction

583.1M9](/packages/league-tactician-doctrine)[trntv/yii2-command-bus

Yii2 Command Bus extension

57625.1k8](/packages/trntv-yii2-command-bus)[simple-bus/doctrine-orm-bridge

Doctrine ORM bridge for using command and event buses

292.1M9](/packages/simple-bus-doctrine-orm-bridge)

PHPackages © 2026

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