PHPackages                             phpfluent/eventmanager - 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. phpfluent/eventmanager

ActiveLibrary

phpfluent/eventmanager
======================

1.0.0(11y ago)10292MITPHP

Since Aug 8Pushed 11y ago5 watchersCompare

[ Source](https://github.com/PHPFluent/EventManager)[ Packagist](https://packagist.org/packages/phpfluent/eventmanager)[ Docs](http://github.com/PHPFluent/EventManager)[ RSS](/packages/phpfluent-eventmanager/feed)WikiDiscussions master Synced 1mo ago

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

PHPFluent\\EventManager
=======================

[](#phpfluenteventmanager)

[![Build Status](https://camo.githubusercontent.com/f02b82a3cb2fae0d11c2f8177df43f5a71886f226b9b255bc0642f7ac4d9d180/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f504850466c75656e742f4576656e744d616e616765722e7376673f7374796c653d666c61742d737175617265)](http://travis-ci.org/PHPFluent/EventManager)[![Code Coverage](https://camo.githubusercontent.com/f9b96991d5d0df152fdeec130848992289245507c193dfb1e9bc3eed6fcee646/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f504850466c75656e742f4576656e744d616e616765722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/PHPFluent/EventManager)[![Code Quality](https://camo.githubusercontent.com/d4ad65c6b057a8d57548b5047a549981cfa830d9750cef4f95f59c5d9ff84494/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f504850466c75656e742f4576656e744d616e616765722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/PHPFluent/EventManager)[![Latest Stable Version](https://camo.githubusercontent.com/86e11f547e94b54902eea82338f23ae34e96668ca4c5f48dfbc1941e961016e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706870666c75656e742f6576656e746d616e616765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpfluent/eventmanager)[![Total Downloads](https://camo.githubusercontent.com/24a4b2d870a91771ee1eeacb024c9e3bf4ea78c55e1eb53e4ca1917d7557ae23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706870666c75656e742f6576656e746d616e616765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpfluent/eventmanager)[![License](https://camo.githubusercontent.com/ae1548d86c862972cbedfa8a253144c36430cea1abdfd1865a1fa278950e26f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f706870666c75656e742f6576656e746d616e616765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpfluent/eventmanager)

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

[](#installation)

Package is available on [Packagist](https://packagist.org/packages/phpfluent/eventmanager), you can install it using [Composer](http://getcomposer.org).

```
composer require phpfluent/eventmanager
```

Usage
-----

[](#usage)

### *Fluent* API

[](#fluent-api)

```
$eventManager = new Manager();
$eventManager->updated = function() { // Add listener to the event "updated"
    echo 'Updated' . PHP_EOL;
);
$eventManager->updated(); // Dispatch event "updated"
```

```
$eventManager = new Manager();
$eventManager->created = function(array $data) { // Add listener to the event "created"
    echo 'Created ' . json_encode($data) . PHP_EOL;
);
$eventManager->created($user); // Dispatch event "created"
```

### *Non-Fluent* API

[](#non-fluent-api)

```
$eventManager = new Manager();

$eventManager->addEventListener(
    "updated",
    function() {
        echo "updated\n";
    }
);

$eventManager->dispatchEvent("updated");
```

```
$eventManager = new Manager();

$eventManager->addEventListener(
    "created",
    function(array $data) {
        echo 'Created ' . json_encode($data) . PHP_EOL;
    }
);

$eventManager->dispatchEvent("created", $user);
```

### Predefined Listeners:

[](#predefined-listeners)

- **Callback:** uses a [`callable`](http://php.net/manual/en/language.types.callable.php) as listener (default as the sample above).
- **Process:** work with [Arara\\Process](https://github.com/arara/process) to create asynchronous listeners.
- **PThread:** uses the [pthreads extension](http://pthreads.org/) as asynchronous listener.

#### [Samples](sample)

[](#samples)

- [Adding Events](sample/events.php)
- [Dispatch Events](sample/sample-1.php)
- [Events with Arguments](sample/sample-2.php)
- [Stop Event Propagation](sample/sample-3.php)
- [Using the Listener Interface](sample/sample-4.php)
- [Listener With Arara\\Process](sample/sample-5.php)
- [Listener With pThreads](sample/sample-6.php)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 82.6% 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

Unknown

Total

1

Last Release

4278d ago

### Community

Maintainers

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

---

Top Contributors

[![henriquemoody](https://avatars.githubusercontent.com/u/154023?v=4)](https://github.com/henriquemoody "henriquemoody (19 commits)")[![kinncj](https://avatars.githubusercontent.com/u/292542?v=4)](https://github.com/kinncj "kinncj (4 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/phpfluent-eventmanager/health.svg)

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

PHPackages © 2026

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