PHPackages                             websupply/event-dispatcher - 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. websupply/event-dispatcher

ActiveNeos-package[Utility &amp; Helpers](/categories/utility)

websupply/event-dispatcher
==========================

0.0.1(3y ago)334PHP

Since Feb 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/wbsply/event-dispatcher)[ Packagist](https://packagist.org/packages/websupply/event-dispatcher)[ RSS](/packages/websupply-event-dispatcher/feed)WikiDiscussions main Synced today

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

PSR-14 Event Dispatcher for Neos Flow
=====================================

[](#psr-14-event-dispatcher-for-neos-flow)

Symfony EventDispatcher integrated with auto-discover!

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

[](#installation)

`composer require websupply/event-dispatcher`

PSR-14 integration
------------------

[](#psr-14-integration)

This package integrates the PSR-14 functionality. But instead of reinventing the wheel, the package implements `symfony/event-dispatcher`.

How to use it
-------------

[](#how-to-use-it)

With the configuration in `Configuration/Objects.yaml` you can inject/instantiate the `Psr\EventDispatcher\EventDispatcherInterface` interface

```
use Psr\EventDispatcher\EventDispatcherInterface;

public function __construct(
    protected readonly EventDispathcerInterface $eventDispathcer
) {}

public function method(string $argument): void
{
    // what ever business logic goes before the dispatching
    $this->eventDispatcher->dispatch(new ProductWasCreated($argument));
}
```

The Event
---------

[](#the-event)

A event to dispatch is stripped down to be a plain PHP object and could look like this

```
namespace Project;

use ValueObject;

final class ProductWasCreated
{
    public function __construct(
        public readonly ValueObject\ProductId $id,
        public readonly ValueObject\ProductName $name
    ) {}
}
```

The Event Listener
------------------

[](#the-event-listener)

Similar to the Event class, the EventListener is a plain PHP object, but with a important `#[EventListener]` annotation brought to you by the `WebSupply\EventDispatcher\Annotations\EventListener` class.

It must implement the `__invoke(..)` method, with the corresponding event class as argument

This example injects a PSR logger and adds a note about the newly created product

```
use WebSupply\EventDispatcher\Annotations\EventListener;
use ProductWasCreated;
use Psr\Log\LoggerInterface;

#[EventListener]
final class ProductWasCreatedListener
{

    public function __construct(protected readonly LoggerInterface $logger)
    {}
    public function __invoke(ProductWasCreated $event)
    {
        $this->logger->info('Product was created', ['id' => (string) $event->id]);
    }
}
```

CLI tool for overview
---------------------

[](#cli-tool-for-overview)

The command `./flow events:list` gives you a list of resolved event and listeners.

If you end up having a ton of events and listeners, you can filter the list, to show listeners based on a single event, by adding a `--event ""` arguments

```
./flow commands:list --command "ProductWasCreated"
```

Support and sponsoring
----------------------

[](#support-and-sponsoring)

Work on this package is supported by the danish web company **WebSupply ApS**

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

1240d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/531918?v=4)[Søren Malling](/maintainers/sorenmalling)[@sorenmalling](https://github.com/sorenmalling)

---

Top Contributors

[![sorenmalling](https://avatars.githubusercontent.com/u/531918?v=4)](https://github.com/sorenmalling "sorenmalling (1 commits)")

---

Tags

flowframeworkneosflow

### Embed Badge

![Health badge](/badges/websupply-event-dispatcher/health.svg)

```
[![Health](https://phpackages.com/badges/websupply-event-dispatcher/health.svg)](https://phpackages.com/packages/websupply-event-dispatcher)
```

###  Alternatives

[symfony/mailer

Helps sending emails

1.6k409.1M1.4k](/packages/symfony-mailer)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.2k](/packages/friendsofphp-php-cs-fixer)[phpro/soap-client

A general purpose SoapClient library

8896.1M54](/packages/phpro-soap-client)[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k8.8M118](/packages/deptrac-deptrac)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)

PHPackages © 2026

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