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

Abandoned → [initphp/events](/?search=initphp%2Fevents)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

initphp/event-emitter
=====================

PHP Event Emitter (DEPRECATED — merged into initphp/events:^2.0)

1.0.1(1mo ago)01221MITPHPPHP &gt;=5.6

Since Jul 9Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/InitPHP/EventEmitter)[ Packagist](https://packagist.org/packages/initphp/event-emitter)[ RSS](/packages/initphp-event-emitter/feed)WikiDiscussions main Synced 3w ago

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

InitPHP EventEmitter
====================

[](#initphp-eventemitter)

> ## ⚠️ DEPRECATED — Use [`initphp/events`](https://github.com/InitPHP/Events) instead
>
> [](#️-deprecated--use-initphpevents-instead)
>
> As part of the InitPHP package consolidation, **this package has been merged into [`initphp/events`](https://github.com/InitPHP/Events) starting with version 2.0.** The new package bundles the same `EventEmitter` primitive plus the higher-level `Events` / `Event` facade.
>
> This repository is kept read-only for historical reference. The final release (`1.0.1`) ships a bug fix for `EventEmitter::emit()` (see below) but **no further updates will be released**.
>
> ### Migration
>
> [](#migration)
>
> 1. Update your `composer.json`:
>
>     ```
>     - "initphp/event-emitter": "^1.0",
>     + "initphp/events": "^2.0"
>     ```
> 2. Your existing imports keep working: `initphp/events:^2.0` ships a `class_alias` so `\InitPHP\EventEmitter\EventEmitter` and `\InitPHP\EventEmitter\EventEmitterInterface` remain resolvable.
> 3. When you next touch the code, prefer the canonical namespace:
>
>     ```
>     // Before
>     use InitPHP\EventEmitter\EventEmitter;
>
>     // After
>     use InitPHP\Events\EventEmitter;
>     ```
>
> Composer declares a `replace` from `initphp/events:^2.0` to `initphp/event-emitter`, so the two packages will not be installed side-by-side.
>
> ### `emit()` bug fix in 1.0.1
>
> [](#emit-bug-fix-in-101)
>
> Version `1.0.1` of this package contains a single bug fix in `EventEmitter::emit()`: the inner loop now correctly passes each individual `$listener` to `call_user_func_array`, instead of the surrounding `$listeners` array. Before this fix, emitted events fired no listeners.

---

This library has been designed to emit events in its simplest and simplest form.

Requirements
------------

[](#requirements)

- PHP 5.6 or higher

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

[](#installation)

```
composer require initphp/event-emitter

```

or **Manuel Installation :**

Download this repository. And include the `src/Init.php` file in your project.

Usage
-----

[](#usage)

```
require_once "vendor/autoload.php";
use InitPHP\EventEmitter\EventEmitter;

$events = new EventEmitter();

$events->on('hello', function ($name) {
    echo 'Hello ' . $name . '!' . PHP_EOL;
}, 99);

$events->on('hello', function ($name) {
    echo 'Hi ' . $name . '!' . PHP_EOL;
}, 10);

// Emit
$events->emit('hello', ['World']);
```

Credits
-------

[](#credits)

- [Muhammet ŞAFAK](https://www.muhammetsafak.com.tr) &lt;&gt;

License
-------

[](#license)

Copyright © 2022 [MIT License](./LICENSE)

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance92

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

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

Total

2

Last Release

40d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b6b34f3ac8938d8ee52ba3bd260680855dc5715c7b2929d9380de30d15a67dd?d=identicon)[muhammetsafak](/maintainers/muhammetsafak)

---

Top Contributors

[![muhammetsafak](https://avatars.githubusercontent.com/u/104234499?v=4)](https://github.com/muhammetsafak "muhammetsafak (3 commits)")

---

Tags

event-emitterevent-emitter-callbackevent-emitterseventemittereventsphpphp-eventphp56php7

### Embed Badge

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

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

###  Alternatives

[emadha/laravel-dynamic-config

This Package makes it possible for users to have their config files stored in a database table, making it easier to customize these values from UI.

141.2k](/packages/emadha-laravel-dynamic-config)

PHPackages © 2026

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