PHPackages                             onix-systems-php/hyperf-policy - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. onix-systems-php/hyperf-policy

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

onix-systems-php/hyperf-policy
==============================

Policy library for hyperf

v1.2.0(2y ago)02.5kMITPHPPHP &gt;=8.1

Since Dec 13Pushed 2y ago3 watchersCompare

[ Source](https://github.com/onix-systems-php/hyperf-policy)[ Packagist](https://packagist.org/packages/onix-systems-php/hyperf-policy)[ RSS](/packages/onix-systems-php-hyperf-policy/feed)WikiDiscussions main Synced yesterday

READMEChangelog (8)Dependencies (10)Versions (9)Used By (0)

Hyperf-policy component
=======================

[](#hyperf-policy-component)

Uses Symfony-like voters to check permissions

Install:

```
composer require onix-systems-php/hyperf-policy
```

To make it works, you need:

1. create policy class based on `OnixSystemsPHP\HyperfPolicy\Policy\AbstractPolicy`
2. add `OnixSystemsPHP\HyperfPolicy\Annotation\Policy` annotation to the policy and setup it's priority (higher number executes first)
3. specify what classes\\objects and actions your policy will work with
4. specify vote logic and return one of the values:

    1. `PolicyVote::ACCESS_DENIED` - stop execution and throw exception specified in `getException` method
    2. `PolicyVote::ACCESS_GRANTED` - allow current action and skip all following policies
    3. `PolicyVote::ACCESS_ABSTAIN` - go to next policy, allow action if no policies left to check
5. create data specifier class based on `OnixSystemsPHP\HyperfPolicy\Policy\AbstractDataSpecifier`
6. add `OnixSystemsPHP\HyperfPolicy\Annotation\DataSpecifier` annotation to the specifier and setup it's priority (higher number executes first)
7. specify what repositories and actions your specifier will work with

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~51 days

Recently: every ~85 days

Total

8

Last Release

941d ago

PHP version history (2 changes)v1.0.0PHP &gt;=8.0

v1.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/120366899?v=4)[Onix Systems PHP](/maintainers/onix-systems-php)[@onix-systems-php](https://github.com/onix-systems-php)

---

Top Contributors

[![alexsyvolap](https://avatars.githubusercontent.com/u/80973788?v=4)](https://github.com/alexsyvolap "alexsyvolap (1 commits)")[![vmikhav](https://avatars.githubusercontent.com/u/11061723?v=4)](https://github.com/vmikhav "vmikhav (1 commits)")

---

Tags

phpauthorizationhyperfPolicy

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/onix-systems-php-hyperf-policy/health.svg)

```
[![Health](https://phpackages.com/badges/onix-systems-php-hyperf-policy/health.svg)](https://phpackages.com/packages/onix-systems-php-hyperf-policy)
```

###  Alternatives

[96qbhy/hyperf-auth

hyperf 的 auth 组件

194235.2k32](/packages/96qbhy-hyperf-auth)[hyperf-ext/jwt

The Hyperf JWT package.

53140.6k2](/packages/hyperf-ext-jwt)[hyperf-ext/auth

The Hyperf Auth package.

2380.1k3](/packages/hyperf-ext-auth)

PHPackages © 2026

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