PHPackages                             actualwave/events - 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. actualwave/events

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

actualwave/events
=================

Includes Event, EventDispatcher classes and IEventDispatcher interface for events support.

0.0.2(10y ago)026MITPHPPHP &gt;=7.0.0

Since Dec 11Pushed 10y ago1 watchersCompare

[ Source](https://github.com/burdiuz/php-event-dispatcher)[ Packagist](https://packagist.org/packages/actualwave/events)[ Docs](https://github.com/burdiuz/php-event-dispatcher)[ RSS](/packages/actualwave-events/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

\##PHP-Events [![Build Status](https://camo.githubusercontent.com/085e9f042d401ac39dc06a2c157f89b7c57c11b50875f2988ece07c5d080ecb7/68747470733a2f2f7472617669732d63692e6f72672f6275726469757a2f7068702d6576656e742d646973706174636865722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/burdiuz/php-event-dispatcher)[![Coverage Status](https://camo.githubusercontent.com/9bfc21d6fbc69906cf0f0675dbc9c9b840df99072c9cfaa3184a9393311251ae/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6275726469757a2f7068702d6576656e742d646973706174636865722f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/burdiuz/php-event-dispatcher?branch=master)[![Dependency Status](https://camo.githubusercontent.com/2a4d792dfc67d3cfa576d989d47b6f66d126c20703baef8306294e1abfd309f6/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3536386262366534656234663437303033633030313339642f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/568bb6e4eb4f47003c00139d)[![Latest Stable Version](https://camo.githubusercontent.com/63006bc8b6c44e05311e235498a12d5ffae22e22e18ae9eda344bf9301bfac1b/68747470733a2f2f706f7365722e707567782e6f72672f61637475616c776176652f6576656e74732f762f737461626c65)](https://packagist.org/packages/actualwave/events) [![Total Downloads](https://camo.githubusercontent.com/eb59dc0b14ebde7d24614d06de9361e0cf97d5ef3d3007f6e0332d8b9fb5d38f/68747470733a2f2f706f7365722e707567782e6f72672f61637475616c776176652f6576656e74732f646f776e6c6f616473)](https://packagist.org/packages/actualwave/events) [![License](https://camo.githubusercontent.com/b8a856e6fbb6037f242a2826a3ea70426acb48b214c97d3a0f0273a667e212a1/68747470733a2f2f706f7365722e707567782e6f72672f61637475616c776176652f6576656e74732f6c6963656e7365)](https://packagist.org/packages/actualwave/events)

Events allow easy setup and use for communication between components in application. Event can notify about state changes and pass data of any kind.

### Installation

[](#installation)

Via [composer](https://getcomposer.org/)

```
composer require actualwave/events

```

### Usage

[](#usage)

To use events you don't need to implement any interfaces, just create `EventDispatcher`and register some listeners for events.

```
class Broadcaster {
  const EVENT_FIRST = 'eventFirst';
  const EVENT_SECOND = 'eventSecond';
  const EVENT_THIRD = 'eventThird';
  /**
   * @var \aw\events\EventDispatcher
   */
  private $_dispatcher;

  //TODO add dispatcher target test
  public function __construct() {
    $this->_dispatcher = new \aw\events\EventDispatcher();
  }

  public function addHandler(string $eventType, callable $handler) {
    $this->_dispatcher->addEventListener($eventType, $handler);
  }

  public function doFirst() {
    echo 'do first and tell ';
    $this->_dispatcher->dispatchEvent(self::EVENT_FIRST);
  }

  public function doSecond() {
    echo 'do second and tell ';
    $this->_dispatcher->dispatchEvent(new \aw\events\ValueEvent(self::EVENT_SECOND, 'pass some data'));
  }

  public function doThird() {
    echo 'do third and tell ';
    $this->_dispatcher->dispatchEvent(self::EVENT_THIRD);
  }
}
```

After `EventDispatcher` is instantiated, you can add listeners and dispatch events.

```
$target = new Broadcaster();
// register event handlers
$target->addHandler(Broadcaster::EVENT_FIRST, function ($event) {
  echo $event->type . PHP_EOL;
});

function secondHandler($event) {
  echo 'handler was called with data: '.$event->value.PHP_EOL;
}

$target->addHandler(Broadcaster::EVENT_SECOND, 'secondHandler');
$target->addHandler(Broadcaster::EVENT_THIRD, [new class () {
  public function eventHandler($event) {
    echo 'event has target: '.json_encode(isset($event->target)).PHP_EOL;
  }
}, 'eventHandler']);
// broadcast events
$target->doThird(); // do third and tell event has target: true
$target->doSecond(); // do second and tell handler was called with data: pass some data
$target->doFirst(); // do first and tell eventFirst
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

2

Last Release

3783d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c10f33e471855407609160df895479e2f52f7d1e262ff56fccc8053322d47b5?d=identicon)[a\_\[w\]](/maintainers/a_[w])

---

Top Contributors

[![burdiuz](https://avatars.githubusercontent.com/u/255853?v=4)](https://github.com/burdiuz "burdiuz (21 commits)")

---

Tags

eventlistenercallbackcomponentdispatchercommunicationfire

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/actualwave-events/health.svg)

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

###  Alternatives

[league/event

Event package

1.6k141.6M184](/packages/league-event)[winzou/state-machine

A very lightweight yet powerful PHP state machine

52113.7M18](/packages/winzou-state-machine)[contributte/event-dispatcher

Best event dispatcher / event manager / event emitter for Nette Framework

292.4M19](/packages/contributte-event-dispatcher)[supervisorphp/event

Listen to Supervisor events in PHP

1442.4k](/packages/supervisorphp-event)

PHPackages © 2026

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