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

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

yaknet/event-dispatcher
=======================

An enterprise-grade, highly modular, PSR-14 compliant event dispatching component with priority listener providers and event subscribers.

v1.0.4(2w ago)07MITPHPPHP &gt;=8.2

Since May 30Pushed 2w agoCompare

[ Source](https://github.com/y-packages/event-dispatcher)[ Packagist](https://packagist.org/packages/yaknet/event-dispatcher)[ RSS](/packages/yaknet-event-dispatcher/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (9)Versions (6)Used By (0)

YakNet Event Dispatcher Component
=================================

[](#yaknet-event-dispatcher-component)

[![PHP Version Support](https://camo.githubusercontent.com/79ac6c4536a3331e3d827319dd782adf525bdd6289ee5748a7023086c9ed0930/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e322d626c75652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yaknet/event-dispatcher)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![PHPStan Analysis](https://camo.githubusercontent.com/95ad671a386caa3fc96a820cfdd0797d0094138dddcf57ce117e8cf8a568bc81/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c25323035253230636c65616e2d707572706c652e7376673f7374796c653d666c61742d737175617265)](https://phpstan.org/)[![Tests Status](https://camo.githubusercontent.com/937e105fc83966d970d459cb02a1c3da1ba44f5e9522992176e869fce65b8a52/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d70617373696e672d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://phpunit.de/)

An enterprise-grade, highly modular, **PSR-14 compliant Event Dispatcher** component. Designed with high-performance prioritizations, class inheritance listener resolution, and flexible subscriber architectures, it acts as the decoupled central nervous communication system for complex PHP systems.

---

Features
--------

[](#features)

- **⚡ PSR-14 Compliant:** Implements standard `psr/event-dispatcher` interfaces, making it fully interoperable with standard PHP frameworks.
- **📈 Prioritized Listener Execution:** Easily assign custom weights/priorities to listeners to enforce strict execution flows.
- **🛡️ Stoppable Propagation:** Leverage stoppable events (extending `AbstractStoppableEvent`) to allow critical listeners to halt downstream propagation on demand.
- **🧩 Class &amp; Interface Inheritance Resolution:** Listeners bound to parent classes or interfaces are automatically resolved and executed when child events are dispatched!
- **🔄 Event Subscribers (Symfony-style):** Bundle multiple event listeners cleanly inside a single subscriber class using `EventSubscriberInterface`.
- **🔗 Composite Aggregation:** Aggregate multiple listener providers into a single unified chain using the advanced `AggregateListenerProvider` pattern.
- **✨ Zero Runtime Dependencies:** Extremely fast, clean, and highly modular.

---

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

[](#installation)

Add this package to your project using Composer (ensure your local repository mapping is configured):

```
composer require yaknet/event-dispatcher
```

---

Quick Start
-----------

[](#quick-start)

### 1. Basic Prioritized Event Dispatching

[](#1-basic-prioritized-event-dispatching)

Define a custom event and register prioritized closures:

```
