PHPackages                             parable-php/event - 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. parable-php/event

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

parable-php/event
=================

Parable Events is a simple event system

1.0.0(5y ago)44962MITPHPPHP &gt;=8.0

Since Aug 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/parable-php/event)[ Packagist](https://packagist.org/packages/parable-php/event)[ Docs](https://github.com/parable-php/event)[ RSS](/packages/parable-php-event/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (2)

Parable Event
=============

[](#parable-event)

[![Workflow Status](https://github.com/parable-php/event/workflows/Tests/badge.svg)](https://github.com/parable-php/event/actions?query=workflow%3ATests)[![Latest Stable Version](https://camo.githubusercontent.com/03edc2b9b420d17b56badae4c10245c949686b9ccff34249ef4ec69e835d2607/68747470733a2f2f706f7365722e707567782e6f72672f70617261626c652d7068702f6576656e742f762f737461626c65)](https://packagist.org/packages/parable-php/event)[![Latest Unstable Version](https://camo.githubusercontent.com/4f9cb864e191cad2fa7d5ce50495cb348991c0d0902a33681a2c30ac5317b096/68747470733a2f2f706f7365722e707567782e6f72672f70617261626c652d7068702f6576656e742f762f756e737461626c65)](https://packagist.org/packages/parable-php/event)[![License](https://camo.githubusercontent.com/a00975317b2a86da7054d7b800e1dd5b6d4618e3ddf151073624af1df458beb2/68747470733a2f2f706f7365722e707567782e6f72672f70617261626c652d7068702f6576656e742f6c6963656e7365)](https://packagist.org/packages/parable-php/event)

Parable Event is a straightforward event system that gets the job done.

Install
-------

[](#install)

Php 8.0+ and [composer](https://getcomposer.org) are required.

```
$ composer require parable-php/event
```

Usage
-----

[](#usage)

Events are very simple. You add listeners to events (`string` values) and then trigger an update with those events. You can pass payloads into the `trigger` calls, which will get passed to all relevant listeners.

```
use \Parable\Event\Events;

$eventManager = new Events();

$eventManager->listen('event_number_one', function (string $event, string &$payload) {
    $payload .= '-updated!';
});

$payload = 'event';

$eventManager->trigger('event_number_one', $payload);

echo $payload;

// output: 'event-updated!'
```

The above example handily shows how to make scalar values modifiable by defining the parameter to the callable as a reference. Passing objects is generally advisable, but sometimes it's the in-place alteration of string values you need.

It's also possible to have a listener trigger on every single event.

```
$eventManager->listenAll(function (string $event, $payload) {
    echo $event . PHP_EOL;
});
```

The above example would simply log all events being updated. This can be handy for debugging, but can also be handy to listen to a specific subset of events by matching the event, rather than adding a single listener to all individual events.

API
---

[](#api)

- `listen(string $event, callable $$listener): void` - add listener to an event
- `listenAll(callable $$listener): void` - add listener for all events
- `trigger(string $event, $payload): void` - trigger an update for an event

Contributing
------------

[](#contributing)

Any suggestions, bug reports or general feedback is welcome. Use github issues and pull requests, or find me over at [devvoh.com](https://devvoh.com).

License
-------

[](#license)

All Parable components are open-source software, licensed under the MIT license.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity71

Established project with proven stability

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

Recently: every ~235 days

Total

6

Last Release

1894d ago

Major Versions

0.4.0 → 1.0.02021-03-12

PHP version history (2 changes)0.1.0PHP &gt;=7.1

0.3.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7db40df70c77a9d591de4521642b0ddcb6c448e4876b22dc2f76900c736ab579?d=identicon)[robindevoh](/maintainers/robindevoh)

---

Tags

eventeventshooklistenersmicroobserversparablephp8triggerseventlibrarylistenerobserverparable

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/parable-php-event/health.svg)

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

###  Alternatives

[league/event

Event package

1.6k141.6M184](/packages/league-event)[jbzoo/event

Library for event-based development

29760.0k5](/packages/jbzoo-event)[supervisorphp/event

Listen to Supervisor events in PHP

1442.4k](/packages/supervisorphp-event)

PHPackages © 2026

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