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

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

ghostwriter/event-dispatcher
============================

Event Dispatcher implementation.

6.0.2(5mo ago)25.1M—6.5%12BSD-4-ClausePHPPHP ~8.4.0 || ~8.5.0

Since Oct 11Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ghostwriter/event-dispatcher)[ Packagist](https://packagist.org/packages/ghostwriter/event-dispatcher)[ Docs](https://github.com/ghostwriter/event-dispatcher)[ GitHub Sponsors](https://github.com/sponsors/ghostwriter)[ RSS](/packages/ghostwriter-event-dispatcher/feed)WikiDiscussions 6.0.x Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (39)Used By (12)

Event Dispatcher
================

[](#event-dispatcher)

[![GitHub Sponsors](https://camo.githubusercontent.com/4e8a371f3ee24c23340ea502d1b6dc7bbe02cb6529035330d292e78408a6bd40/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73706f6e736f72732f67686f73747772697465723f6c6162656c3d53706f6e736f722b4067686f73747772697465722f6576656e742d64697370617463686572266c6f676f3d4769744875622b53706f6e736f7273)](https://github.com/sponsors/ghostwriter)[![Automation](https://github.com/ghostwriter/event-dispatcher/actions/workflows/automation.yml/badge.svg)](https://github.com/ghostwriter/event-dispatcher/actions/workflows/automation.yml)[![Supported PHP Version](https://camo.githubusercontent.com/e7f257a1d933a90730b90057d2523eeb9dcec21e27bd88651f207a765186804b/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f67686f73747772697465722f6576656e742d646973706174636865723f636f6c6f723d383839326266)](https://www.php.net/supported-versions)[![Downloads](https://camo.githubusercontent.com/dfa5a327283d73748b4226cd7a26b1fbefb80695aa4e5e9407103509b99dc612/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f67686f73747772697465722f6576656e742d646973706174636865723f636f6c6f723d626c7565)](https://packagist.org/packages/ghostwriter/event-dispatcher)

Provides an Event Dispatcher implementation for PHP.

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

[](#installation)

You can install the package via composer:

```
composer require ghostwriter/event-dispatcher
```

### Star ⭐️ this repo if you find it useful

[](#star-️-this-repo-if-you-find-it-useful)

You can also star (🌟) this repo to find it easier later.

### Usage

[](#usage)

Registering and dispatching an Event Listener.

```
use Ghostwriter\EventDispatcher\EventDispatcher;
use Ghostwriter\EventDispatcher\ListenerProvider;

// Create an event class
final class ExampleEvent
{
}

// Create an Event Listener
final class ExampleEventListener
{
    public function __invoke(ExampleEvent $event): void
    {
        // Handle the event, e.g., print the event class name
        // echo $event::class;
    }
}

// Create a ListenerProvider
$listenerProvider = ListenerProvider::new(); // or new ListenerProvider(Container::getInstance())

// Bind the Listener to the Event
$listenerProvider->listen(ExampleEvent::class, ExampleEventListener::class);

// Create an EventDispatcher
$dispatcher = EventDispatcher::new($listenerProvider); // or new EventDispatcher($listenerProvider)

// Dispatch the Event.
$event = $dispatcher->dispatch(new ExampleEvent());

// Assert the Event is the same as the dispatched Event
assert($event instanceof ExampleEvent);
```

### Changelog

[](#changelog)

Please see [CHANGELOG.md](./CHANGELOG.md) for more information what has changed recently.

### Security

[](#security)

If you discover any security related issues, please email `nathanael.esayeas@protonmail.com` or create a [Security Advisory](https://github.com/ghostwriter/event-dispatcher/security/advisories/new) instead of using the issue tracker.

License
-------

[](#license)

The BSD-3-Clause. Please see [License File](./LICENSE) for more information.

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance81

Actively maintained with recent releases

Popularity46

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity76

Established project with proven stability

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

Recently: every ~30 days

Total

25

Last Release

54d ago

Major Versions

2.0.0 → 3.0.02023-11-12

3.0.0 → 4.0.02024-02-06

4.0.0 → 5.0.02024-05-22

5.0.x-dev → 6.0.02025-11-20

6.1.x-dev → 7.0.x-dev2026-03-25

PHP version history (9 changes)1.0.0PHP &gt;=8.0,&lt;8.3

1.3.0PHP &gt;=8.1,&lt;8.3

1.4.2PHP &gt;=8.1 &lt;8.4

2.0.0PHP &gt;=8.2

4.0.0PHP ^8.3

5.0.0PHP &gt;=8.3

5.0.3PHP &gt;=8.4

5.1.x-devPHP ^8.4

5.0.x-devPHP ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1dbb0131801cc451dad9917ab29aa823b25d7eebc9f3875a9d481d109bdb44ee?d=identicon)[ghostwriter](/maintainers/ghostwriter)

---

Top Contributors

[![ghostwriter](https://avatars.githubusercontent.com/u/9754361?v=4)](https://github.com/ghostwriter "ghostwriter (1860 commits)")

---

Tags

event-dispatcherghostwriterpsreventspsr-14event dispatcherghostwriter

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psr/event-dispatcher

Standard interfaces for event handling.

2.3k618.8M865](/packages/psr-event-dispatcher)[crell/tukio

A robust, stand-alone PSR-14 event dispatcher implementation.

112183.8k13](/packages/crell-tukio)[fig/event-dispatcher-util

Useful utility classes and traits for implementing the PSR events standard

27423.2k19](/packages/fig-event-dispatcher-util)[phly/phly-event-dispatcher

Experimental event dispatcher for PSR-14

26209.9k4](/packages/phly-phly-event-dispatcher)

PHPackages © 2026

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