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 2w 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 41% 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

2440d 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

[odolbeau/phone-number-bundle

Integrates libphonenumber into your Symfony application

24810.9M16](/packages/odolbeau-phone-number-bundle)[wp-cli/wp-config-transformer

Programmatically edit a wp-config.php file.

8510.5M8](/packages/wp-cli-wp-config-transformer)[sagem-cassiopee/php-metar-decoder

METAR weather observation decoder

527.8k](/packages/sagem-cassiopee-php-metar-decoder)[assistant-engine/filament-assistant

A Filament Assistant package that enables AI features, bringing advanced assistant capabilities directly into Filament.

392.7k](/packages/assistant-engine-filament-assistant)

PHPackages © 2026

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