PHPackages                             xiaolin/enum - 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. xiaolin/enum

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

xiaolin/enum
============

enum

0.2.1(7y ago)01271MITPHPPHP &gt;=5.6

Since Nov 24Pushed 7y agoCompare

[ Source](https://github.com/missxiaolin/enum)[ Packagist](https://packagist.org/packages/xiaolin/enum)[ RSS](/packages/xiaolin-enum/feed)WikiDiscussions master Synced 3d ago

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

enum
====

[](#enum)

安装
--

[](#安装)

```
composer require xiaolin/enum

```

使用
--

[](#使用)

### 定义枚举类

[](#定义枚举类)

```
use xiaolin\Enum\Enum;
class ErrorCode extends Enum
{
    /**
     * @Message('非法的TOKEN')
     */
    public static $ENUM_INVALID_TOKEN = 700;
}

```

```
$code = ErrorCode::$ENUM_INVALID_TOKEN;
$message = ErrorCode::getMessage($code);

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

Total

4

Last Release

2894d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05b5e817e8addc30803144d902d3ed6028bc474bf6cc82d872180cc5903b373b?d=identicon)[missxiaolin](/maintainers/missxiaolin)

---

Top Contributors

[![missxiaolin](https://avatars.githubusercontent.com/u/26253292?v=4)](https://github.com/missxiaolin "missxiaolin (22 commits)")

---

Tags

xiaolin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xiaolin-enum/health.svg)

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

###  Alternatives

[flesler/jquery.scrollto

Lightweight, cross-browser and highly customizable animated scrolling with jQuery

3.7k40.1k](/packages/flesler-jqueryscrollto)[gossi/php-code-generator

Toolset for generating PHP code

148203.9k32](/packages/gossi-php-code-generator)[outl1ne/nova-page-manager

Page(s) and region(s) manager for Laravel Nova.

17945.1k](/packages/outl1ne-nova-page-manager)[verbb/calendar-links

Generate add-to-calendar links for Google, iCal and other calendar systems.

169.4k](/packages/verbb-calendar-links)[rtippin/messenger-ui

Laravel messenger suite UI.

156.4k1](/packages/rtippin-messenger-ui)

PHPackages © 2026

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