PHPackages                             nepada/phpstan-message-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. [Testing &amp; Quality](/categories/testing)
4. /
5. nepada/phpstan-message-bus

ActivePhpstan-extension[Testing &amp; Quality](/categories/testing)

nepada/phpstan-message-bus
==========================

PHPStan extension for nepada/message-bus.

v4.0.1(7mo ago)12.0k↓50%BSD-3-ClausePHPPHP &gt;=7.4.0 &lt;8.6CI passing

Since Jul 21Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/nepada/phpstan-message-bus)[ Packagist](https://packagist.org/packages/nepada/phpstan-message-bus)[ RSS](/packages/nepada-phpstan-message-bus/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (13)Used By (0)

PHPStan Message Bus extension
=============================

[](#phpstan-message-bus-extension)

[![Build Status](https://github.com/nepada/phpstan-message-bus/workflows/CI/badge.svg)](https://github.com/nepada/phpstan-message-bus/actions?query=workflow%3ACI+branch%3Amaster)[![Coverage Status](https://camo.githubusercontent.com/1599158b5bdb181b69e50f6e8feac20e5ddda7b5c0ff030231c9ae6abdda623d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e65706164612f7068707374616e2d6d6573736167652d6275732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/nepada/phpstan-message-bus?branch=master)[![Downloads this Month](https://camo.githubusercontent.com/db60124d7413581ad4599fa0b06cd8dfd1f532d0d497603009adfcab340a7273/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e65706164612f7068707374616e2d6d6573736167652d6275732e737667)](https://packagist.org/packages/nepada/phpstan-message-bus)[![Latest stable](https://camo.githubusercontent.com/0bb99bdc6f0564451113c3290a814020ddeb0f2e2dd32901fa08164ecb56d84a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e65706164612f7068707374616e2d6d6573736167652d6275732e737667)](https://packagist.org/packages/nepada/phpstan-message-bus)

- [PHPStan](https://github.com/phpstan/phpstan)
- [nepada/message-bus](https://github.com/nepada/message-bus)

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

[](#installation)

Via Composer:

```
composer require --dev nepada/phpstan-mesasge-bus
```

Unless you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) you need to manually enable the extension in your config:

```
includes:
    - vendor/nepada/phpstan-message-bus/extension.neon
```

Either way, you need to specify the directories in which your command handlers are located:

```
parameters:
    commandHandlerDirectories:
        - app
        - src
```

Description
-----------

[](#description)

The package currently provides only one extension - `DynamicMethodThrowTypeExtension`. The extension propagates exception thrown by command handlers up to the command bus caller.

```
final class FooService
{

    private \Nepada\MessageBus\Commands\CommandBus $commandBus;

    public function __construct(\Nepada\MessageBus\Commands\CommandBus $commandBus)
    {
        $this->commandBus = $commandBus;
    }

    public function placeOrder(): void
    {
        try {
            $command = new PlaceOrderCommand();
            $this->commandBus->handle($command);
        } catch (FailedToPlaceOrderException $exception) {
            // FailedToPlaceOrderException may be thrown and needs to handled
        }
    }

}

final class PlaceOrderCommand implements \Nepada\MessageBus\Commands\Command
{

}

final class PlaceOrderHandler implements \Nepada\MessageBus\Commands\CommandHandler
{

    /**
     * @param PlaceOrderCommand $command
     * @throws FailedToPlaceOrderException
     */
    public function __invoke(PlaceOrderCommand $command): void
    {
        throw new FailedToPlaceOrderException('Failed to place order');
    }

}

class FailedToPlaceOrderException extends \RuntimeException
{

}
```

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance75

Regular maintenance activity

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 58.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 ~189 days

Total

11

Last Release

233d ago

Major Versions

v2.1.1 → v3.0.02021-11-06

v3.2.1 → v4.0.02024-11-11

PHP version history (6 changes)v2.0.0PHP &gt;=7.4.0

v3.0.0PHP &gt;=7.4.0 &lt;8.2

v3.0.1PHP &gt;=7.4.0 &lt;8.3

v3.1.1PHP &gt;=7.4.0 &lt;8.4

v3.2.1PHP &gt;=7.4.0 &lt;8.5

v4.0.1PHP &gt;=7.4.0 &lt;8.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b4780fe328102c4572737db639653c29d3081d1d3e051467f00d7f09a776399?d=identicon)[xificurk](/maintainers/xificurk)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (97 commits)")[![xificurk](https://avatars.githubusercontent.com/u/117465?v=4)](https://github.com/xificurk "xificurk (70 commits)")

---

Tags

PHPStanmessage busnepada

###  Code Quality

TestsPHPUnit

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nepada-phpstan-message-bus/health.svg)

```
[![Health](https://phpackages.com/badges/nepada-phpstan-message-bus/health.svg)](https://phpackages.com/packages/nepada-phpstan-message-bus)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[ekino/phpstan-banned-code

Detected banned code using PHPStan

2925.6M92](/packages/ekino-phpstan-banned-code)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

3462.2M52](/packages/shipmonk-dead-code-detector)[szepeviktor/phpstan-wordpress

WordPress extensions for PHPStan

3257.8M898](/packages/szepeviktor-phpstan-wordpress)[staabm/phpstan-dba

2912.3M2](/packages/staabm-phpstan-dba)[staabm/phpstan-todo-by

1991.8M55](/packages/staabm-phpstan-todo-by)

PHPackages © 2026

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