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 1mo ago

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 14% 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

1188d 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

[phpro/soap-client

A general purpose SoapClient library

8885.6M46](/packages/phpro-soap-client)[winzou/state-machine

A very lightweight yet powerful PHP state machine

52113.7M18](/packages/winzou-state-machine)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)[eliashaeussler/typo3-form-consent

Extension for TYPO3 CMS that adds double opt-in functionality to EXT:form

1481.0k](/packages/eliashaeussler-typo3-form-consent)[numero2/contao-storelocator

Contao Plugin for managing stores (or in common address data) and providing a frontend-search based on geo data

121.5k](/packages/numero2-contao-storelocator)

PHPackages © 2026

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