PHPackages                             nekopoi/events - 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. nekopoi/events

ActiveLibrary

nekopoi/events
==============

php事件和promise

v1.6.2(5y ago)014mitPHP

Since Mar 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/LikeNeko/php_events)[ Packagist](https://packagist.org/packages/nekopoi/events)[ RSS](/packages/nekopoi-events/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (9)Used By (0)

```
class MyEvents extends \Neko\Events\Events {
    const EventCallBack = "EventCallBack";

    public static function EventCallBack(\Closure $func)
    {
        self::listen(self::EventCallBack,$func);
    }
}

MyEvents::EventCallBack(function (){
    var_dump('trigger'.random_int(1,10));
    return random_int(1,10);
});

MyEvents::trigger(MyEvents::EventCallBack);
//string(9) "trigger10"

MyEvents::trigger(MyEvents::EventCallBack);
//string(8) "trigger2"

// 会缓存结果
$num1 = MyEvents::trigger_once(MyEvents::EventCallBack);
$num2 = MyEvents::trigger_once(MyEvents::EventCallBack);
//array(2) {
//  ["num1"]=>
//  int(9)
//  ["num2"]=>
//  int(9)
//}

// 清除缓存结果
MyEvents::clear_cache(MyEvents::EventCallBack);
$num1 = MyEvents::trigger_once(MyEvents::EventCallBack);
$num2 = MyEvents::trigger_once(MyEvents::EventCallBack);
var_dump(['num1'=>$num1,'num2'=>$num2]);

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

8

Last Release

1894d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d0774add39082411460fa7540715a9979956d03460f27cfcc841b40131401894?d=identicon)[LikeNeko](/maintainers/LikeNeko)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/nekopoi-events/health.svg)

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

PHPackages © 2026

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