PHPackages                             php-pico/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. [Framework](/categories/framework)
4. /
5. php-pico/event

ActiveLibrary[Framework](/categories/framework)

php-pico/event
==============

A PSR-14 Event Dispatcher package.

0.1.2(1mo ago)02MITPHP ^8.5

Since Jul 6Compare

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

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

php-pico/event
==============

[](#php-picoevent)

A PSR-14 Event Dispatcher package.

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

[](#installation)

```
composer require php-pico/event
```

Requires PHP ^8.5.

Usage
-----

[](#usage)

### Registering listeners

[](#registering-listeners)

```
use PhpPico\Event\ListenerProvider;

$listenerProvider = new ListenerProvider();

$listenerProvider->listen(UserRegistered::class, function (UserRegistered $event): void {
    // handle the event
});
```

Listeners also receive events for classes implementing the registered interface, or extending the registered class:

```
$listenerProvider->listen(Throwable::class, function (Throwable $event): void {
    // invoked for any Throwable, including subclasses
});
```

### Dispatching events

[](#dispatching-events)

```
use PhpPico\Event\EventDispatcher;

$dispatcher = new EventDispatcher($listenerProvider);

$dispatcher->dispatch(new UserRegistered($user));
```

Listeners are invoked in the order they were registered.

### Stoppable events

[](#stoppable-events)

Events implementing `Psr\EventDispatcher\StoppableEventInterface` can halt propagation to remaining listeners:

```
use Psr\EventDispatcher\StoppableEventInterface;

final class UserRegistered implements StoppableEventInterface
{
    private bool $stopped = false;

    public function stop(): void
    {
        $this->stopped = true;
    }

    public function isPropagationStopped(): bool
    {
        return $this->stopped;
    }
}
```

Once `stop()` is called from within a listener, no further listeners are invoked for that dispatch.

Extend `PhpPico\Event\AbstractStoppableEvent` to get this behavior for free:

```
use PhpPico\Event\AbstractStoppableEvent;

final class UserRegistered extends AbstractStoppableEvent
{
    public function __construct(
        public readonly User $user,
    ) {}
}
```

`AbstractStoppableEvent` already implements `stop()` and `isPropagationStopped()`, so the event class only needs to declare its own data.

Testing
-------

[](#testing)

```
composer test
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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

Total

3

Last Release

48d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33836112?v=4)[Kevin From](/maintainers/kevinfrom)[@kevinfrom](https://github.com/kevinfrom)

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.4M2.2k](/packages/symfony-symfony)[symfony/mailer

Helps sending emails

1.6k424.2M1.7k](/packages/symfony-mailer)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6943.5M450](/packages/drupal-core-recommended)[spiral/framework

Spiral, High-Performance PHP/Go Framework

2.1k2.3M73](/packages/spiral-framework)

PHPackages © 2026

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