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

ActiveL

tioncico/event-hook
===================

1.1(6y ago)048Apache-2.0PHP

Since Sep 11Pushed 6y ago1 watchersCompare

[ Source](https://github.com/tioncico/EventHook)[ Packagist](https://packagist.org/packages/tioncico/event-hook)[ RSS](/packages/tioncico-event-hook/feed)WikiDiscussions master Synced 3d ago

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

EventHook
=========

[](#eventhook)

hook事件组件 借鉴tp5写的hook事件

```
$eventHook = EventHook::getInstance();
//闭包函数
$result = $eventHook->add('test',function ($a,$b,$c){
    $this->assertEquals($a,1);
    $this->assertEquals($b,2);
    $this->assertEquals($c,3);
    return [$a,$b,$c];
});
$this->assertTrue(!!$result);

//传入类名
$result = $eventHook->add('test',Test::class);
$this->assertTrue(!!$result);

//传入类名+方法名数组
$result = $eventHook->add('test',[Test::class,'test']);
$this->assertTrue(!!$result);

//传入一个类
$result = $eventHook->add('test',new TestClass());
$this->assertTrue(!!$result);

$result = $eventHook->listen('test',false,1,2,3);
foreach ($result as  $value){
    $this->assertEquals($value,[1,2,3]);
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

2394d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d05a3f5bdd7b1b6b01e36330fa52eeb54d1bef5eb0a419e0b53631e9c30b078?d=identicon)[tioncico](/maintainers/tioncico)

---

Top Contributors

[![tioncico](https://avatars.githubusercontent.com/u/31308307?v=4)](https://github.com/tioncico "tioncico (6 commits)")

### Embed Badge

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

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

###  Alternatives

[easyswoole/easyswoole

An efficient swoole framework

4.8k186.9k50](/packages/easyswoole-easyswoole)[easyswoole/rpc

An efficient swoole framework

7731.6k2](/packages/easyswoole-rpc)[easyswoole/kafka

An efficient swoole framework

4211.1k](/packages/easyswoole-kafka)[lys/easy-swoole-rabbitmq

214.4k](/packages/lys-easy-swoole-rabbitmq)[easyswoole/easy-whoops

Whoops provider for easySwoole framework 3.x

114.3k1](/packages/easyswoole-easy-whoops)[easyswoole/words-match

An efficient swoole framework

171.6k3](/packages/easyswoole-words-match)

PHPackages © 2026

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