PHPackages                             jersoncarin/jershooks - 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. jersoncarin/jershooks

ActiveLibrary

jersoncarin/jershooks
=====================

A lightweight Hooking API inspired by wordpress

1.0.0(5y ago)110MITPHPPHP ^8.0

Since Jan 16Pushed 5y ago2 watchersCompare

[ Source](https://github.com/jersoncarin/hooks)[ Packagist](https://packagist.org/packages/jersoncarin/jershooks)[ RSS](/packages/jersoncarin-jershooks/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Jers Hooks API for PHP
======================

[](#jers-hooks-api-for-php)

JersHooks is a hooking system which inspired by wordpress hooking api

- apply\_filters
- add\_filter
- remove\_filter
- add\_action
- do\_action
- remove\_action

Requirements
============

[](#requirements)

- PHP 8.0+

Installation
============

[](#installation)

```
composer require jersoncarin/jershooks
```

How to use
==========

[](#how-to-use)

```
$hooks = new \Jersnet\Framework\Hook\Hooks;

// adding action to the hooks
// Note: it can be a closure, a function and a class method
// add_action(string $tag,mixed $object,int $priority,int $args_limit)
$hooks->add_action('action_name',function(){
    // some code
});

// Firing an action
// do_action(string $tag,...$args);
// you can pass as many as you can arguments
$hooks->do_action('action_name');

// Removing an action
// remove_action(string $tag,callable $callable,int $priority = 10)
// Third argument is optional
$hooks->remove_action('action_name','some_function');

// Has action(s)
// Returns boolean
$hooks->has_action('action_name','some_function');
$hooks->has_actions();

// adding filter to the hooks
// Note: it can be a closure, a function and a class method
// add_filter(string $tag,mixed $object,int $priority,int $args_limit)
$hooks->add_filter('filter_name',function($arg){
    // some code
});

// Removing an filter
// remove_filter(string $tag,callable $callable,int $priority = 10)
// Third argument is optional
$hooks->remove_filter('filter_name','some_function');

// Has filter(s)
// Returns boolean
$hooks->has_filter('action_name','some_function');
$hooks->has_filters();

// Applying Filters
// Apply filters to a hook
// apply_filters(string $tag,mixed $value,mixed ...$args)
// Return mixed
$hooks->apply_filters('filter_name','some_filter','extra_filer');
```

Author
======

[](#author)

- Jerson Carin

License
=======

[](#license)

- MIT License

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

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

Unknown

Total

1

Last Release

1939d ago

### Community

Maintainers

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

---

Top Contributors

[![jersoncarin](https://avatars.githubusercontent.com/u/63774442?v=4)](https://github.com/jersoncarin "jersoncarin (13 commits)")

### Embed Badge

![Health badge](/badges/jersoncarin-jershooks/health.svg)

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

PHPackages © 2026

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