PHPackages                             lengbin/hyperf-error-code - 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. lengbin/hyperf-error-code

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

lengbin/hyperf-error-code
=========================

hyperf error code

3.0.x-dev(3y ago)02.3k1MITPHPPHP &gt;=8.0

Since Oct 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ice-leng/hyperf-error-code)[ Packagist](https://packagist.org/packages/lengbin/hyperf-error-code)[ RSS](/packages/lengbin-hyperf-error-code/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (3)Used By (1)

 [ ![](https://camo.githubusercontent.com/c6b942122d0a55df522901b30c6f0b467688ed244a0225113157462fc2249d50/68747470733a2f2f6879706572662e6f73732d636e2d68616e677a686f752e616c6979756e63732e636f6d2f6879706572662e706e67) ](https://hyperf.io/)

Hyperf Error Code Command
=========================

[](#hyperf-error-code-command)

If You Like This Please Give Me Star

Install
-------

[](#install)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require lengbin/hyperf-error-code

```

or add

```
"lengbin/hyperf-error-code": "*"

```

to the require section of your `composer.json` file.

you can see [document](https://github.com/ice-leng/error-code)

Configs
-------

[](#configs)

```
    // 配置 /config/autoload/errorCode.php
    return [
        // 错误码文件 目录
        'path'           => [
            BASE_PATH . '/app/Constant/Errors'
        ],
        // 合并生成 类 文件名称
        'classname'      => 'Error',
        // 合并生成 类 命名空间
        'classNamespace' => 'App\\Constant',
        // 合并生成 类 文件输出目录
        'output'         => BASE_PATH . '/app/Constant',
    ];

class ErrorCode extends BaseEnum
{
    /**
     * @Message("成功")
     */
    const SUCCESS = '0';
}

$error = ErrorCode::byValue(ErrorCode::SUCCESS);

$error->getName();  // SUCCESS
// 支持多语言
$error->getMessage([], 'zh-CN'); // 成功
$error->getValue(); // 0
```

Publish
-------

[](#publish)

```
php ./bin/hyperf.php vendor:publish lengbin/hyperf-error-code
```

Usage
-----

[](#usage)

```
php ./bin/hyperf.php gen:error-code
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

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

Total

2

Last Release

1404d ago

Major Versions

2.0.x-dev → 3.0.x-dev2022-07-15

PHP version history (2 changes)2.0.x-devPHP &gt;=7.2.0

3.0.x-devPHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9342ed631e7bf15897f2e15d0a853800b84cb315e601eb3a58f2cc8938b5d011?d=identicon)[ice.leng](/maintainers/ice.leng)

---

Top Contributors

[![ice-leng](https://avatars.githubusercontent.com/u/7506787?v=4)](https://github.com/ice-leng "ice-leng (9 commits)")

---

Tags

phpextensioncommandhyperferror codehyperf-command

### Embed Badge

![Health badge](/badges/lengbin-hyperf-error-code/health.svg)

```
[![Health](https://phpackages.com/badges/lengbin-hyperf-error-code/health.svg)](https://phpackages.com/packages/lengbin-hyperf-error-code)
```

###  Alternatives

[hyperf/watcher

Hot reload watcher for Hyperf

17846.7k27](/packages/hyperf-watcher)

PHPackages © 2026

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