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

ActiveLibrary[Framework](/categories/framework)

fwk/events
==========

Lightweight Event Dispatcher for Happy Developers

v2.0.0(10y ago)15713BSD-3-ClausePHPPHP &gt;=5.4.0

Since Jul 24Pushed 10y agoCompare

[ Source](https://github.com/fwk/Events)[ Packagist](https://packagist.org/packages/fwk/events)[ RSS](/packages/fwk-events/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)DependenciesVersions (4)Used By (3)

Fwk\\Events (Event Dispatcher)
==============================

[](#fwkevents-event-dispatcher)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6106cb9ebb9df9a16604fd9971cc08ec34845081fe1c4353a51333e803689b6d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66776b2f4576656e74732f6261646765732f7175616c6974792d73636f72652e706e673f733d66643330316165616532616365643930623430303565383532633135356336393933323031663766)](https://scrutinizer-ci.com/g/fwk/Events/)[![Build Status](https://camo.githubusercontent.com/3cc9f3dcccae1bde2be9402a2b9a450201cd04c817db887021da04f99032321e/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f66776b2f4576656e74732e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/fwk/Events)[![Code Coverage](https://camo.githubusercontent.com/b8f39d280228188896d9fa4a48b39186a0e9ea6b209d1917caa1bd3c18b4dad5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66776b2f4576656e74732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fwk/Events/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/7881a70b5bede086a0346a91b50da2013d63a9e3841e2275795e7e3ae57cefe5/68747470733a2f2f706f7365722e707567782e6f72672f66776b2f6576656e74732f762f737461626c652e706e67)](https://packagist.org/packages/fwk/events)[![Total Downloads](https://camo.githubusercontent.com/28baad945cc040edf1cc34e31fb7207786092a6ac70c82498a4dad7fa1466d3d/68747470733a2f2f706f7365722e707567782e6f72672f66776b2f6576656e74732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/fwk/events)[![Latest Unstable Version](https://camo.githubusercontent.com/6dc0f7c421ae242f87828df6e509408b13ecafd7596caa888635297db42802ae/68747470733a2f2f706f7365722e707567782e6f72672f66776b2f6576656e74732f762f756e737461626c652e706e67)](https://packagist.org/packages/fwk/events)[![License](https://camo.githubusercontent.com/d05899a499eabb988c217dc2f8cd4e09b723868921f304ffe97c429f88154619/68747470733a2f2f706f7365722e707567782e6f72672f66776b2f64692f6c6963656e73652e706e67)](https://packagist.org/packages/fwk/events)

Event Dispatcher for PHP 5.4+

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

[](#installation)

Via [Composer](http://getcomposer.org):

```
{
    "require": {
        "fwk/events": "dev-master",
    }
}

```

If you don't use Composer, you can still [download](https://github.com/fwk/Events/zipball/master) this repository and add it to your `include_path` [PSR-0 compatible](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md)

Documentation
-------------

[](#documentation)

### Adding Listeners

[](#adding-listeners)

```
use Fwk\Events\Dispatcher,
    Fwk\Events\Event;

$evd = new Dispatcher();

// closures listeners
$evd->on("eventName", function(Fwk\Events\Event $event) {
    // do some stuff
});

// Class methods starting by "on[EventCamelCasedName]" can also be added as
// listeners
class MyListener
{
    public function onEventName(Fwk\Events\Event $event) {
        // do some stuff
    }
}

$evd->addListener(new MyListener());
```

### Removing Listeners

[](#removing-listeners)

```
/* ... */

// this removes all listeners for a given event
$evd->removeAllListeners("eventName");

// this removes a listener (callable) for a given event
$evd->removeListener("eventName", array($listener, "onListenerMethod"));
```

### Trigger Events

[](#trigger-events)

```
/* ... */

$event = new Fwk\Events\Event("eventName", array(
    "someData" => "someValue"
));
$event->extraData = "extraValue";

// dispatch event
$evd->notify($event);
```

Contributions / Community
-------------------------

[](#contributions--community)

- Issues on Github:
- Follow *Fwk* on Twitter: [@phpfwk](https://twitter.com/phpfwk)

Legal
-----

[](#legal)

Fwk is licensed under the 3-clauses BSD license. Please read LICENSE for full details.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

3

Last Release

3666d ago

Major Versions

1.0.x-dev → v2.0.02016-06-15

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

v2.0.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/57451?v=4)[Julien](/maintainers/neiluJ)[@neiluJ](https://github.com/neiluJ)

---

Top Contributors

[![neiluJ](https://avatars.githubusercontent.com/u/57451?v=4)](https://github.com/neiluJ "neiluJ (27 commits)")

---

Tags

fwkphpeventframeworkeventsutilsdispatcherhappy-developer

### Embed Badge

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

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

###  Alternatives

[cakephp/event

CakePHP event dispatcher library that helps implementing the observer pattern

22332.8k23](/packages/cakephp-event)

PHPackages © 2026

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