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

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

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 4w 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 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

2

Last Release

2485d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/31308307?v=4)[仙士可](/maintainers/tioncico)[@tioncico](https://github.com/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

[dgr/nohup

A library to run a command in the background, it will return the process's pid, and get it's is running status anytime in the another process, and can be stoped anytime. It support Windows, Linux and Mac osx.

531.7k](/packages/dgr-nohup)

PHPackages © 2026

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