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. [Utility &amp; Helpers](/categories/utility)
4. /
5. shancept/event

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

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 today

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 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

1314d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25472994?v=4)[shancept](/maintainers/shancept)[@shancept](https://github.com/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)
```

###  Alternatives

[mattiasgeniar/php-percentages

A clean interface to calculate percentages in PHP: changes between values, percentage increases, partial values, ...

203344.6k](/packages/mattiasgeniar-php-percentages)[vinelab/url-shortener

URL shortening the easy way.

6217.2k](/packages/vinelab-url-shortener)[print-filament/print

The print-filament package is a simple and efficient tool that allows users to quickly print the current webpage directly from their browser. This plugin enhances the convenience of printing online content by providing a one-click solution for generating printer-friendly versions of the pages you're viewing.

147.6k](/packages/print-filament-print)[dlds/yii2-mlm

Yii2 Multi Level Marketing component

173.8k](/packages/dlds-yii2-mlm)

PHPackages © 2026

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