PHPackages                             willy68/pg-eventdispacher - 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. willy68/pg-eventdispacher

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

willy68/pg-eventdispacher
=========================

Event system manager

v1.0.2(10mo ago)015MITPHPPHP &gt;=8.1CI passing

Since Jun 18Pushed 10mo agoCompare

[ Source](https://github.com/willy68/pg-eventdispatcher)[ Packagist](https://packagist.org/packages/willy68/pg-eventdispacher)[ RSS](/packages/willy68-pg-eventdispacher/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

pg-eventdispatcher
==================

[](#pg-eventdispatcher)

[![Latest Stable Version](https://camo.githubusercontent.com/481813962645a7319bf38dd55e1185e0ecac3ae4fde75b2f16962c2fada7885c/687474703a2f2f706f7365722e707567782e6f72672f77696c6c7936382f70672d6576656e746469737061636865722f76)](https://packagist.org/packages/willy68/pg-eventdispacher)[![Total Downloads](https://camo.githubusercontent.com/e9be712aa958013ceb88e28f8716a53997a3658efc80825d3de6613e8775e6f8/687474703a2f2f706f7365722e707567782e6f72672f77696c6c7936382f70672d6576656e746469737061636865722f646f776e6c6f616473)](https://packagist.org/packages/willy68/pg-eventdispacher)[![Latest Unstable Version](https://camo.githubusercontent.com/202282d3c07c19f79d15e09508ad1269ea304ab16174b0ff279bdffe36c8d3d5/687474703a2f2f706f7365722e707567782e6f72672f77696c6c7936382f70672d6576656e746469737061636865722f762f756e737461626c65)](https://packagist.org/packages/willy68/pg-eventdispacher)[![License](https://camo.githubusercontent.com/ef25dc10709c2373cc60d84e3a5ff0037509150b959ef59aa89fedd9bee6b6b2/687474703a2f2f706f7365722e707567782e6f72672f77696c6c7936382f70672d6576656e746469737061636865722f6c6963656e7365)](https://packagist.org/packages/willy68/pg-eventdispacher)[![PHP Version Require](https://camo.githubusercontent.com/fb8885e504d72baf026daee0d4830f830220c8b41576890c027b947a84cba0d3/687474703a2f2f706f7365722e707567782e6f72672f77696c6c7936382f70672d6576656e746469737061636865722f726571756972652f706870)](https://packagist.org/packages/willy68/pg-eventdispacher)[![Coverage Status](https://camo.githubusercontent.com/8e9a8e7e5cb2c3ccf49dbe264c4391bb3d3dd8bd43b7da55db0677e636e4b8f2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f77696c6c7936382f70672d6576656e74646973706174636865722f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/willy68/pg-eventdispatcher?branch=main)

Psr14 Event Dispatcher

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

[](#installation)

```
composer require willy68/pg-eventdispatcher
```

Subscribe to this dispatcher
----------------------------

[](#subscribe-to-this-dispatcher)

The array keys are event names and the value can be:

The method name to call (priority defaults to 0)
The priority (default \_\_invoke class method)
The eventName (default \_\_invoke class method) (priority defaults to 0)
An array composed of the method name to call and the priority

For instance:

```
 ['eventName' => 'methodName'] //default priority 0
 ['eventName' => ListenerPriority::HIGH] //default __invoke method
 ['eventName'] //default __invoke method with default priority 0
 ['eventName' => ['methodName', ListenerPriority::HIGH]] //methodName with high priority
```

Example
-------

[](#example)

```
use Pg\Event\EventSubscriberInterface;
use League\Event\ListenerPriority;
use Pg\Event\EventDispatcher;

class MyListener implements EventSubscriberInterface
{
    public function __invoke(RequestEvent $event)
    {
        // Handle the event
    }

    public static function getSubscribedEvents(): array
    {
        return [
            RequestEvent::NAME => ListenerPriority::HIGH
        ];
    }
}

$dispatcher = new EventDispatcher($callableResolver);
$dispatcher->subscribeListener(MyListener::class);
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance53

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

Total

3

Last Release

328d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ee0f14e65474268155360744e058f5a000e5d865d1e07211241554d89f792a5?d=identicon)[willy68](/maintainers/willy68)

---

Top Contributors

[![willy68](https://avatars.githubusercontent.com/u/34144331?v=4)](https://github.com/willy68 "willy68 (17 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/willy68-pg-eventdispacher/health.svg)

```
[![Health](https://phpackages.com/badges/willy68-pg-eventdispacher/health.svg)](https://phpackages.com/packages/willy68-pg-eventdispacher)
```

###  Alternatives

[infinum/eightshift-libs

WordPress libs developed by Eightshift team to use in modern WordPress.

63118.9k3](/packages/infinum-eightshift-libs)[macfja/phar-builder

12611.8k11](/packages/macfja-phar-builder)[paulredmond/html-to-amp

A PHP Library to Convert HTML to AMP HTML

6826.0k](/packages/paulredmond-html-to-amp)[refinery29/league-lazy-event

Provides a LazyListener for use with league/event which allows for lazy fetching of actual listeners.

1523.3k](/packages/refinery29-league-lazy-event)

PHPackages © 2026

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