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

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

caridea/event
=============

A shrimp of an event library

3.0.0(8y ago)08893Apache-2.0PHPPHP &gt;=7.1.0

Since Jun 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/libreworks/caridea-event)[ Packagist](https://packagist.org/packages/caridea/event)[ Docs](http://github.com/libreworks/caridea-event)[ RSS](/packages/caridea-event/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (9)Used By (3)

caridea-event
=============

[](#caridea-event)

Caridea is a miniscule PHP application library. This shrimpy fellow is what you'd use when you just want some helping hands and not a full-blown framework.

[![](https://camo.githubusercontent.com/3a9d2bd9abd336c1541d254cd07f8dff935288ad4a0983294f0b3f572f5b0f4b/687474703a2f2f6c69627265776f726b732e636f6d2f636172696465612d3130302e706e67)](https://camo.githubusercontent.com/3a9d2bd9abd336c1541d254cd07f8dff935288ad4a0983294f0b3f572f5b0f4b/687474703a2f2f6c69627265776f726b732e636f6d2f636172696465612d3130302e706e67)

This is its event library. It has interfaces for Publisher and Listener, and an abstract class for Event.

If you'd like a concrete implementation of `Publisher`, try [caridea-container](https://github.com/libreworks/caridea-container).

[![Packagist](https://camo.githubusercontent.com/0aa9d07c080b91b9cccffe211ca1ac6e19ca11ab29d6c9a81dbb86b37753fcdc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636172696465612f6576656e742e737667)](https://packagist.org/packages/caridea/event)[![Build Status](https://camo.githubusercontent.com/2c6001bfa0a0ad8ac14953754619da2563113b245bcd8a3e282876379ffd856f/68747470733a2f2f7472617669732d63692e6f72672f6c69627265776f726b732f636172696465612d6576656e742e737667)](https://travis-ci.org/libreworks/caridea-event)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9585c1fd99da4fb3c96caf2e6c0add448d7f5238b289358e663ae2ca52c07219/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c69627265776f726b732f636172696465612d6576656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/libreworks/caridea-event/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/37af178f5b5fcf7765d2f11af8d3472110d00e6c54093887fcb9ceb7d764e818/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c69627265776f726b732f636172696465612d6576656e742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/libreworks/caridea-event/?branch=master)

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

[](#installation)

You can install this library using Composer:

```
$ composer require caridea/event
```

- The master branch (version 3.x) of this project requires PHP 7.1 and has no dependencies.
- Version 2.x of this project requires PHP 7.0 and has no dependencies.
- Version 1.x of this project requires PHP 5.5 and has no dependencies.

Compliance
----------

[](#compliance)

Releases of this library will conform to [Semantic Versioning](http://semver.org).

Our code is intended to comply with [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/), and [PSR-4](http://www.php-fig.org/psr/psr-4/). If you find any issues related to standards compliance, please send a pull request!

Documentation
-------------

[](#documentation)

- Head over to [Read the Docs](http://caridea-event.readthedocs.io/en/latest/)

Examples
--------

[](#examples)

Just a few quick examples.

Let's say you have defined these classes

```
namespace Acme\Foo;

class CustomEvent extends \Caridea\Event\Event
{
}

class CustomEventListener implements \Caridea\Event\Listener
{
    public function notify(\Caridea\Event\Event $event)
    {
        if ($event instanceof CustomEvent) {
            // do something here
        }
    }
}
```

A publisher can be invoked like this:

```
// Here, we assume that $publisher implements a \Caridea\Event\Publisher and that
// We have somehow registered an \Acme\Foo\CustomEventListener with it.
$publisher->publish(new \Acme\Foo\CustomEvent());
// Our CustomEventListener has its ->notify method invoked.
```

There's a no-op implementation of `Publisher` available as `\Caridea\Event\NullPublisher`.

### PublisherAware

[](#publisheraware)

For classes which need the event publisher, you can make use of the `PublisherAware` interface, and optionally the `PublisherSetter` trait.

```
class MyClass implements \Caridea\Event\PublisherAware
{
    use \Caridea\Event\PublisherSetter;

    public function __construct()
    {
        $this->setPublisher(new \Caridea\Event\NullPublisher());
    }
}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Recently: every ~163 days

Total

8

Last Release

3059d ago

Major Versions

0.1.0 → 1.0.02016-03-21

1.x-dev → 2.0.02016-03-22

2.1.x-dev → 3.0.02018-01-02

PHP version history (3 changes)0.1.0PHP &gt;=5.5.0

2.0.0PHP &gt;=7.0.0

3.0.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/659262eac941ffe4795493834425fc9a2369c2c9df3cc565ed4194f1d37be934?d=identicon)[doublecompile](/maintainers/doublecompile)

---

Top Contributors

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

---

Tags

eventeventslistenerobserver

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[doctrine/event-manager

The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.

6.1k501.1M115](/packages/doctrine-event-manager)[league/event

Event package

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

Trigger and listen to events within a PHP application

1.0k69.8M225](/packages/laminas-laminas-eventmanager)[tormjens/eventy

The WordPress filter/action system in Laravel

438912.9k16](/packages/tormjens-eventy)[jbzoo/event

Library for event-based development

29760.0k5](/packages/jbzoo-event)[zumba/symbiosis

Symbiosis, event structure for bootstrapping plugins.

1360.4k1](/packages/zumba-symbiosis)

PHPackages © 2026

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