PHPackages                             narrator/narrator - 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. narrator/narrator

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

narrator/narrator
=================

Event library

v0.4(9y ago)02.6kMITPHPPHP &gt;=5.6.0

Since Oct 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mleko/narrator)[ Packagist](https://packagist.org/packages/narrator/narrator)[ RSS](/packages/narrator-narrator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

narrator/narrator
=================

[](#narratornarrator)

[![Travis CI](https://camo.githubusercontent.com/7f445b04d212f812f18cb7ac07d0c934653ef641edbcd2f09efa67784275a492/68747470733a2f2f7472617669732d63692e6f72672f6d6c656b6f2f6e61727261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mleko/narrator)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/43adb8075a3573bb57ff808c0fe060e6e3e2a2a4aaa79c0c8f2e599a836e7a0a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6c656b6f2f6e61727261746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mleko/narrator/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/64e4740de35415776035f3fc0d3c9bcf39cdbe918b46a9949f17faba1897bbfe/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6c656b6f2f6e61727261746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mleko/narrator/?branch=master)

Small and simple Event Bus library.

Narrator allows communication between components without requiring the component to explicitly depend on each other.

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

[](#installation)

Using [Composer](http://getcomposer.org/):

```
$ composer require narrator/narrator
```

Basic usage
-----------

[](#basic-usage)

```
// Simple event object
class UserRegistered {
    private $userId;

    private $userName;
    // ...event data, constructor, getters
}
// Sample listener
class UserRegisteredListener implements Listener {

    public function handle($event, Meta $meta){
        // send email, update model, etc
    }
}

// create EventBus which will be responsible for managing events and listeners
$eventBus = new BasicEventBus(new NameBasedResolver(new ClassNameExtractor()));

// create listener instance
$listener = new UserRegisteredListener(...);
// and register it in bus
$eventBus->subscribe(UserRegistered::class, $listener);

// create event
$event = new UserRegistered(...);
// and `emit` it to listeners
$eventBus->emit($event);
```

Testing
-------

[](#testing)

To run unit tests use PHPUnit

```
$ ./vendor/bin/phpunit

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Total

5

Last Release

3338d ago

### Community

Maintainers

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

---

Top Contributors

[![mleko](https://avatars.githubusercontent.com/u/2631527?v=4)](https://github.com/mleko "mleko (35 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[butschster/meta-tags

The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project

628730.7k2](/packages/butschster-meta-tags)

PHPackages © 2026

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