PHPackages                             phpgears/event-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phpgears/event-symfony-messenger

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

phpgears/event-symfony-messenger
================================

Event bus implementation with Symfony's Event Dispatcher

0.2.1(6y ago)2121MITPHPPHP ^7.1CI failing

Since Feb 3Pushed 5y ago1 watchersCompare

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

READMEChangelogDependencies (16)Versions (6)Used By (0)

[![PHP version](https://camo.githubusercontent.com/d0b5687c6812c5d52d86a548e09db527eeb7860f82adbb677de00a36ddbed1b4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344372e312d3838393242462e7376673f7374796c653d666c61742d737175617265)](http://php.net)[![Latest Version](https://camo.githubusercontent.com/57a7846a52fded7d5c62f6766dca374a4dbf51ffed494fa4201f5de7561539c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70687067656172732f6576656e742d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/event-symfony-messenger)[![License](https://camo.githubusercontent.com/a840ea979695717c34b4c2584a6ddabf4045c1c3b555726486bf5c7b2a93eb93/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70687067656172732f6576656e742d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpgears/event-symfony-messenger/blob/master/LICENSE)

[![Build Status](https://camo.githubusercontent.com/8c9a9000ea1e95b0f3c2ba3a71a5e6fb25b77dd4ead4fb6abe0c25d2e4cb5646/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f70687067656172732f6576656e742d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/phpgears/event-symfony-messenger)[![Style Check](https://camo.githubusercontent.com/6e7783d81f7e98f28e2b318dc0c954750bb6bd720ef04a3aee3d842e55b473a9/68747470733a2f2f7374796c6563692e696f2f7265706f732f3136383939383739392f736869656c64)](https://styleci.io/repos/168998799)[![Code Quality](https://camo.githubusercontent.com/8a623e4fe9240703949a7a2b25f4273870e0a479d4ad1482f110241f5f3f0725/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f70687067656172732f6576656e742d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/phpgears/event-symfony-messenger)[![Code Coverage](https://camo.githubusercontent.com/c51f0b0bd0c50312baa0b4f1cdf1d305cf552296caaef53da351f8e4729098e3/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f70687067656172732f6576656e742d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/phpgears/event-symfony-messenger)

[![Total Downloads](https://camo.githubusercontent.com/d6621faee06948127d14349b5997ee6dd593221f254dc3117a6a79251a9a097f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70687067656172732f6576656e742d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/event-symfony-messenger/stats)[![Monthly Downloads](https://camo.githubusercontent.com/eb808e50516e28b81028c24d4fceefd7089a773ca1c153300de5baa6aa862aa5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f70687067656172732f6576656e742d73796d666f6e792d6d657373656e6765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpgears/event-symfony-messenger/stats)

Event bus with Symfony's Messenger
==================================

[](#event-bus-with-symfonys-messenger)

Event bus implementation with Symfony's Messenger

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

[](#installation)

### Composer

[](#composer)

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

```

Usage
-----

[](#usage)

Require composer autoload file

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

### Events Bus

[](#events-bus)

```
use Gears\Event\Symfony\Messenger\EventHandlerLocator;
use Gears\Event\Symfony\Messenger\EventBus;
use Symfony\Component\Messenger\MessageBus;
use Symfony\Component\Messenger\Middleware\HandleMessageMiddleware;

$eventToHandlerMap = [];

/*
 * IMPORTANT! Events can go through messageBus without being handled, set second argument
 *            on Symfony's EventHandlerLocator constructor ($allowNoHandlers) to true
 */
$handlerLocator = new EventHandlerLocator($eventToHandlerMap, true);
$messengerBus = new MessageBus([new HandleMessageMiddleware($handlerLocator)]);

$eventBus = new EventBus($messengerBus);

/** @var \Gears\Event\Event $event */
$eventBus->handle($event);
```

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

[](#contributing)

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

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

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

Total

4

Last Release

2408d 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 (7 commits)")

---

Tags

eventsymfonybus

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[contributte/event-dispatcher

Best event dispatcher / event manager / event emitter for Nette Framework

292.4M19](/packages/contributte-event-dispatcher)[sylius/refund-plugin

Plugin provides basic refunds functionality for Sylius application.

691.7M13](/packages/sylius-refund-plugin)[gomachan46/state-machine

simple state machine with annotations for PHP, inspired by AASM known as a Ruby state machine.

1893.9k](/packages/gomachan46-state-machine)

PHPackages © 2026

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