PHPackages                             folleah/psr7-event-emitter - 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. folleah/psr7-event-emitter

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

folleah/psr7-event-emitter
==========================

PSR-7 event-emitter implementation

26PHP

Since Jun 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Folleah/psr7-event-emitter)[ Packagist](https://packagist.org/packages/folleah/psr7-event-emitter)[ RSS](/packages/folleah-psr7-event-emitter/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

PSR EventManager implementation [![Scrutinizer Code Quality](https://camo.githubusercontent.com/9ff1f39f18fc04137aa66b7d841b44a08bb95363af774099215de2bd69eec1f0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f466f6c6c6561682f707372372d6576656e742d656d69747465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Folleah/psr7-event-emitter/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/3412bad4c670776d2b574ac16e4570af172dcc94d37cf3738299741460c75128/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f466f6c6c6561682f707372372d6576656e742d656d69747465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Folleah/psr7-event-emitter/?branch=master) [![Build Status](https://camo.githubusercontent.com/5f7c48352108355423f1ce4b003bec8f621e5649942fd0ec921cf96457d4ad4c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f466f6c6c6561682f707372372d6576656e742d656d69747465722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Folleah/psr7-event-emitter/build-status/master) [![Build Status](https://camo.githubusercontent.com/b96469139f36dfc48c08fb4d2af0f318159930dfea9fe6c3167c850fec5ad60e/68747470733a2f2f7472617669732d63692e6f72672f466f6c6c6561682f707372372d6576656e742d656d69747465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Folleah/psr7-event-emitter)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#psr-eventmanager-implementation----)

[More about functions](https://github.com/php-fig/fig-standards/blob/master/proposed/event-manager.md)

**Some examples:**

- Security framework that will prevent saving/accessing data when a user doesn't have permission.
- A Common full page caching system
- Logging package to track all actions taken within the application

**Example:**

```
use Event\Event;
use Event\EventManager;

$onGreeted = function($var) {
    echo "Hi, {$var}.";
};

$onAsked = function() {
    echo "How are you?";
};

$onGoodbye = function() {
    echo "Bye!";
};

$eventManager = new EventManager;
$event = new Event('acquaintance');

// Listen this event with priority
$eventManager->attach('acquaintance', $onGreeted, 2);
$eventManager->attach('acquaintance', $onAsked, 1);
$eventManager->attach('bye', $onGoodbye);

/**
 * Call created event
 *
 * output:
 * Hi, Alice.
 * How are you?
 */
$eventManager->trigger($event, null, ['Alice']); // 'Alice' will be passed as argument to the listener callback

/**
 * Create new event and call it
 *
 * output:
 * Bye!
 */
$newEvent = $eventManager->trigger('bye');
```

With the `stopPropagation()` method, you can stop calling the remaining listeners

**Event stop propagation example:**

```
$eventManager = new EventManager;

$helloWorld = function() {
    echo "Hello world!";
};

$eventManager->attach('hello.world', $helloWorld);

$event = $eventManager->trigger('hello.world');
$event->stopPropagation();
// It will not work
$event = $eventManager->trigger('hello.world');
```

**License: [MIT](https://github.com/Folleah/psr7-event-emitter/blob/master/README.md)**

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f565214be5e2d1127ad2d21aa5d0438e240e1b4bcfe2373a61aff600771ecf23?d=identicon)[Folleah](/maintainers/Folleah)

---

Top Contributors

[![folleah](https://avatars.githubusercontent.com/u/6205767?v=4)](https://github.com/folleah "folleah (45 commits)")

### Embed Badge

![Health badge](/badges/folleah-psr7-event-emitter/health.svg)

```
[![Health](https://phpackages.com/badges/folleah-psr7-event-emitter/health.svg)](https://phpackages.com/packages/folleah-psr7-event-emitter)
```

###  Alternatives

[light/hashids

Hashids for Yii2

1120.2k](/packages/light-hashids)

PHPackages © 2026

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