PHPackages                             activecollab/eventsdispatcher - 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. activecollab/eventsdispatcher

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

activecollab/eventsdispatcher
=============================

Dispatch events, and provide event handlers

1.0.0(6y ago)157.6k↓34.3%MITPHPPHP &gt;=7.1

Since May 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/activecollab/eventsdispatcher)[ Packagist](https://packagist.org/packages/activecollab/eventsdispatcher)[ RSS](/packages/activecollab-eventsdispatcher/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

EventsDispatcher
================

[](#eventsdispatcher)

[![Build Status](https://camo.githubusercontent.com/2fa1b4a6e924981feb9b11fc32c864e92e76042d4c131a31c12496e435dceea2/68747470733a2f2f7472617669732d63692e6f72672f616374697665636f6c6c61622f6576656e7473646973706174636865722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/activecollab/eventsdispatcher)

This package offers simple events dispatcher, with listeners. Key concepts:

1. Events are not arbitrary strings, but instances that encapsulate all relevant event data,
2. When you specify a listener, you specify an event class (or interface) that you want to listen to,
3. You can listen to entire classes of events, by specifying general enough event class (or interface),
4. Listeners are callables, and event is always passed to it as the first (and only) argument.

General listener example:

```
