PHPackages                             maer/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. maer/events

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

maer/events
===========

Small package to handle events

0.1.0(10y ago)1215MITPHPPHP &gt;=5.4.0

Since Oct 18Pushed 10y ago1 watchersCompare

[ Source](https://github.com/magnus-eriksson/events)[ Packagist](https://packagist.org/packages/maer/events)[ RSS](/packages/maer-events/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

A small event dispatcher for PHP
================================

[](#a-small-event-dispatcher-for-php)

Need events? Here you go! No fuzz, no overcomplicated instantiation or bloated classes.

Install
-------

[](#install)

Git clone or use composer to download the package with the following command:

```
composer require maer/events 0.*

```

Usage
-----

[](#usage)

Include composers autoloader or include the files in the `src/` folder manually. *(start with the file `EventInterface.php`)*

#### Create a new instance

[](#create-a-new-instance)

```
$event = new Maer\Events\Event();

```

#### Add a listener

[](#add-a-listener)

```
$event->addListener('start_something', 'some-id', function($name) {
    echo "Coolest ever: {$name}";
});

```

#### Trigger/Emit an event

[](#triggeremit-an-event)

```
$response = $event->emit('start_something', ['Chuck Norris']);

// Echoes: Coolest ever: Chuck Norris

```

#### Remove a listener

[](#remove-a-listener)

```
$event->removeListener('start_something', 'some-id');

```

Facade/Factory
--------------

[](#facadefactory)

If you don't want to store the Event class instance yourself, you can use the combined Facade/Factory class.

#### Use it as a Factory

[](#use-it-as-a-factory)

This will always return the same instance

```
$event = Maer\Events\EventFacade::getInstance();

```

#### To use it as a Facade

[](#to-use-it-as-a-facade)

This will use the same instance as getInstance() returns so you can combine the two

```
Maer\Events\EventFacade::addListener(...);

Maer\Events\EventFacade::removeListener(...);

$response = Maer\Events\EventFacade::emit(...);

//... and any other method available in the Event class

```

More...
-------

[](#more)

Above is the basic usage but there is more... I'll update this guide soon.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

3866d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ada6171adca1bf89432dd54fff188ef3d890a71734278bd06b54487f45b5695?d=identicon)[maer](/maintainers/maer)

---

Top Contributors

[![magnus-eriksson](https://avatars.githubusercontent.com/u/3640297?v=4)](https://github.com/magnus-eriksson "magnus-eriksson (2 commits)")

### Embed Badge

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

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

PHPackages © 2026

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