PHPackages                             scones/nexus - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. scones/nexus

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

scones/nexus
============

implementation for the upcoming PSR-14 standard. currently supporting 0.6.0

0.6.1(7y ago)2281MITPHPPHP ~7.2

Since Sep 18Pushed 7y ago1 watchersCompare

[ Source](https://github.com/scones/nexus)[ Packagist](https://packagist.org/packages/scones/nexus)[ Docs](https://github.com/scones/nexus)[ RSS](/packages/scones-nexus/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (7)Versions (5)Used By (0)

[![Build Status](https://camo.githubusercontent.com/fab1d47d74f20120030c5148dda03e7d7cd840fadda7b617ad645db5c7ebce3e/68747470733a2f2f7472617669732d63692e636f6d2f73636f6e65732f6e657875732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/scones/nexus)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c69aadfbd844337987bb704f195fede7dc5144cd90854653ac83f21def72a2dc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73636f6e65732f6e657875732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/scones/nexus/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/fc90f0af85424cd796bb3ce12426bc241119039d3c6b28ff9a1d1bb292f6005e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73636f6e65732f6e657875732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/scones/nexus/?branch=master)

Nexus
=====

[](#nexus)

psr-14 event dispatcher implementation

(honoring psr-12)

Install
-------

[](#install)

In most cases it should suffice to just install it via composer.

`composer require scones/nexus "*@stable"`

Usage
-----

[](#usage)

These exmaples are taken from the tests, so there is of course a bit of redundancy.

### Messages

[](#messages)

The usage is quite basic.

- You define a Message class.
- You provide a callable listener with one argument, which has to match the Message Type it should listen on.
- You call the notfier with an instance of the Message you wish to propagate

```
use Psr\EventDispatcher\MessageInterface;
use Nexus\StandardListenerProvider;
use Nexus\SynchronousNotifier;

class SomeMessage implements MessageInterface
{
}

class SomeOtherMessage implements MessageInterface
{
}

$provider = new StandardListenerProvider();
$notifier = new SynchronousNotifier($provider);

$provider->addListener(function (SomeMessage $someMessage) {
    echo "some cool message reaction code goes here\n";
});
$provider->addListener(function (SomeMessage $someMessage) {
    echo "this message seems worth logging!\n";
});
$provider->addListener(function (SomeOtherMessage $someOtherMessage) {
    echo "oh, the other message was dispatched!\n";
});

$testMessage = new SomeMessage();
$notifier->notify($testMessage);
```

which would of course result in:

```
some cool message reaction code goes here
this message seems worth logging!

```

### Tasks

[](#tasks)

Again the usage is quite simplistic.

- You define a Task class.
- You provide a callable listener with one argument, which has to match the Task Type it should listen on.
- You call the processor with an instance of the Task you wish to propagate
- After all Tasks have processed, the resulting modified task instance is returned.

```
use Nexus\StandardListenerProvider;
use Nexus\SynchronousProcessor;
use Psr\EventDispatcher\TaskInterface;

class SomeTask implements TaskInterface
{
    private $accessCounter = 0;

    public function increaseCounter(): void
    {
        $this->accessCounter++;
    }

    public function getCounter(): int
    {
        return $this->accessCounter;
    }
}

class SomeOtherTask implements TaskInterface
{
}

$provider = new StandardListenerProvider();
$processor = new SynchronousProcessor($provider);

$provider->addListener(function (SomeTask $someTask) {
    echo "some task working!\n";
    $someTask->increaseCounter();
    return $someTask;
});
$provider->addListener(function (SomeTask $someTask) {
    echo "some task working again!\n";
    $someTask->increaseCounter();
    $someTask->increaseCounter();
    return $someTask;
});
$provider->addListener(function (SomeOtherTask $someOtherTask) {
    echo "the other Task!";
    return $someOtherTask;
});

$testTask = new SomeTask();
$testTaskResult = $processor->process($testTask);

echo "task result was: {$testTaskResult->getCounter()}\n";
```

which would of course result in:

```
some task working!
some task working again!
task result was: 3

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

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

Total

4

Last Release

2591d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/472339?v=4)[Lord Dirk Gustke](/maintainers/scones)[@scones](https://github.com/scones)

---

Top Contributors

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

---

Tags

psreventspsr-14event dispatcherTasks

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psr/event-dispatcher

Standard interfaces for event handling.

2.3k650.1M1.3k](/packages/psr-event-dispatcher)[symfony/contracts

A set of abstractions extracted out of the Symfony components

3.9k65.9M132](/packages/symfony-contracts)[tommyknocker/pdo-database-class

Framework-agnostic PHP database library with unified API for MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, and Oracle. Query Builder, caching, sharding, window functions, CTEs, JSON, migrations, ActiveRecord, CLI tools, AI-powered analysis. Zero external dependencies.

826.0k](/packages/tommyknocker-pdo-database-class)

PHPackages © 2026

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