PHPackages                             hydrakit/event - 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. [Framework](/categories/framework)
4. /
5. hydrakit/event

ActiveLibrary[Framework](/categories/framework)

hydrakit/event
==============

PSR-14 event dispatcher for Hydra PHP framework

v0.2.0(yesterday)0162MITPHP &gt;=8.2

Since Jul 2Compare

[ Source](https://github.com/hydra-foundation/event)[ Packagist](https://packagist.org/packages/hydrakit/event)[ RSS](/packages/hydrakit-event/feed)WikiDiscussions Synced today

READMEChangelogDependencies (3)Versions (4)Used By (2)

Hydra Event
===========

[](#hydra-event)

A minimal [PSR-14](https://www.php-fig.org/psr/psr-14/) event dispatcher for the Hydra framework. It lets one subsystem announce that something happened without knowing — or depending on — whoever cares.

Like the rest of Hydra it binds to the PSR interfaces rather than inventing its own: events are plain objects, listeners are callables, and the dispatcher is a `Psr\EventDispatcher\EventDispatcherInterface`. There is nothing to learn beyond the standard.

What it ships
-------------

[](#what-it-ships)

- **`Dispatcher`** — a PSR-14 `EventDispatcherInterface`. `dispatch($event)` calls every matched listener in order and returns the same event object (so a caller can read what listeners left on a mutable event). Honours `StoppableEventInterface`.
- **`ListenerProvider`** — a PSR-14 `ListenerProviderInterface` with one small, non-standard extension: `listen(string $eventType, callable $listener)`. PSR-14 is silent on registration; this is how listeners get in. Matching is by `instanceof`, so a listener on a base class or marker interface fires for every subtype.
- **`EventServiceProvider`** — binds a single shared `ListenerProvider` behind three keys (`ListenerProvider`, `ListenerProviderInterface`, `EventDispatcherInterface`) so the app registers into the same instance the dispatcher reads from.

It ships the mechanism only. Which events matter and who reacts to them is app policy — registered at the composition root, the same "ship the verb, the app supplies the noun" seam as auth's user provider.

Using it
--------

[](#using-it)

Register the provider (before any provider whose services dispatch events):

```
$app->register(new SessionServiceProvider)
    ->register(new EventServiceProvider)
    ->register(new AuthServiceProvider)   // auth picks up the dispatcher if bound
    ->register(new AppServiceProvider);
```

Define an event — a plain object, immutable when it is just a fact:

```
final class OrderPlaced
{
    public function __construct(public readonly int $orderId) {}
}
```

Register a listener where the app composes itself (typically a provider's `boot()`):

```
$container->get(ListenerProvider::class)
    ->listen(OrderPlaced::class, [$auditListener, 'onOrderPlaced']);
```

Dispatch it from wherever the thing happens:

```
$this->events->dispatch(new OrderPlaced($order->id));
```

A subsystem that wants to stay usable without the event package should depend on a nullable `?EventDispatcherInterface` and dispatch with `?->` — exactly what `hydrakit/auth` does.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance100

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

Total

3

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a947272da0bf1d7d6326b4fbf6ddb8049977cbdbe333d0d1282dbb6f5927dfdf?d=identicon)[whleucka](/maintainers/whleucka)

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[shopware/platform

The Shopware e-commerce core

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

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M423](/packages/drupal-core-recommended)[spiral/framework

Spiral, High-Performance PHP/Go Framework

2.1k2.2M68](/packages/spiral-framework)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M582](/packages/shopware-core)

PHPackages © 2026

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