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

ActiveLibrary

shancept/event
==============

Events

v1.0.2(3y ago)04Apache-2.0PHPPHP ^7.4 || ^8.0

Since Nov 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/shancept/event)[ Packagist](https://packagist.org/packages/shancept/event)[ RSS](/packages/shancept-event/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

Events
======

[](#events)

Events allow you to insert custom code into existing code at specific points in execution. You can attach custom code to an event so that when the event fires, the code is automatically executed.

### install:

[](#install)

```
composer require shancept/event
```

### Usage:

[](#usage)

#### first case

[](#first-case)

1. create event class implements [EventInterface](/src/EventInterface.php). [Example](/example/Event/SuccessUserRegistrationEvent.php).
2. create event handler class. [Example](/example/Event/SuccessUserRegistrationHandler.php).
3. call trigger event at the right place `Event::trigger(new Event())`.
4. subscribe to the event before executing it `Event::listen(SomeClass::class, static function ($event) {})`.

#### second case

[](#second-case)

1. use [trait](/src/EventTrait.php) in your class.
2. record all events via `EventTrait::recordEvent`.
3. call in the right place: `EventBus::dispatch()`.
4. pass `EventTrait::releaseEvents` result to the "dispatch" function parameter.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Total

3

Last Release

1267d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6049a52f70b559f613fc958f4175e207447523602fcdd8535f89fb4a09c4ad81?d=identicon)[shancept](/maintainers/shancept)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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