PHPackages                             phpnomad/symfony-event-dispatcher-integration - 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. phpnomad/symfony-event-dispatcher-integration

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

phpnomad/symfony-event-dispatcher-integration
=============================================

Integrates PHPNomad's event architecture with Symfony's event dispatcher.

1.1.1(3mo ago)0175[2 PRs](https://github.com/phpnomad/symfony-event-dispatcher-integration/pulls)1MITPHPCI passing

Since Dec 18Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/phpnomad/symfony-event-dispatcher-integration)[ Packagist](https://packagist.org/packages/phpnomad/symfony-event-dispatcher-integration)[ Docs](https://github.com/phoenix/core)[ RSS](/packages/phpnomad-symfony-event-dispatcher-integration/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)Dependencies (8)Versions (6)Used By (1)

phpnomad/symfony-event-dispatcher-integration
=============================================

[](#phpnomadsymfony-event-dispatcher-integration)

[![Latest Version](https://camo.githubusercontent.com/22c61bf4a413527cc81eff32d47e34c121ba6ed2a1169df2c8ffe7287c84d093/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f73796d666f6e792d6576656e742d646973706174636865722d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/symfony-event-dispatcher-integration)[![Total Downloads](https://camo.githubusercontent.com/b095ce0ce6e2827cbacf29e5a1d33fe3dbc34accdff14cc3c351b7c3a480f449/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f73796d666f6e792d6576656e742d646973706174636865722d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/symfony-event-dispatcher-integration)[![PHP Version](https://camo.githubusercontent.com/8a86d3d0fa0472f0ca466865b97b7a0ddd7e4a8dcc9e882f6fdbafafa7edceba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f73796d666f6e792d6576656e742d646973706174636865722d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/symfony-event-dispatcher-integration)[![License](https://camo.githubusercontent.com/8a55148c164ae3d23336480008882b3daafc0a11303f39615a6e03e4c63c1db4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f73796d666f6e792d6576656e742d646973706174636865722d696e746567726174696f6e2e737667)](https://packagist.org/packages/phpnomad/symfony-event-dispatcher-integration)

Integrates Symfony's EventDispatcher component with PHPNomad's event abstraction. It provides concrete `EventStrategy` and `ActionBindingStrategy` implementations that satisfy the interfaces defined in `phpnomad/event`, so application code that dispatches or listens for events keeps depending on the PHPNomad contracts while the underlying work goes through Symfony's dispatcher. This is the recommended implementation for PHPNomad applications that are not running inside a host platform with its own event system.

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

[](#installation)

```
composer require phpnomad/symfony-event-dispatcher-integration
```

Composer pulls in `phpnomad/event`, `phpnomad/di`, `phpnomad/loader`, and `symfony/event-dispatcher` transitively.

What This Provides
------------------

[](#what-this-provides)

- An `EventStrategy` implementation that wraps each PHPNomad event in a Symfony-compatible event object and dispatches it through `EventDispatcherInterface`. `attach()` supports priorities, and listener callables receive the original PHPNomad event rather than the Symfony wrapper.
- An `ActionBindingStrategy` implementation that binds an arbitrary action name to a PHPNomad event class, with an optional transformer callable for shaping the event instance from the action arguments.
- An `Initializer` class that registers both strategies with the DI container and binds Symfony's `EventDispatcher` to `EventDispatcherInterface`.

Requirements
------------

[](#requirements)

- `phpnomad/event` for the interfaces being implemented
- `phpnomad/di` and `phpnomad/loader` for container wiring
- `symfony/event-dispatcher` ^7.1 for the underlying dispatcher

All four are declared as direct dependencies, so Composer installs them automatically.

Usage
-----

[](#usage)

Add the integration's `Initializer` to your PHPNomad bootstrapper alongside your application initializers. The loader picks up its class definitions and binds both strategies to their PHPNomad interfaces.

```
