PHPackages                             zyimm/php-constants - 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. zyimm/php-constants

ActiveLibrary

zyimm/php-constants
===================

php项目枚举常量配置管理&amp;调用包

0.0.3(2y ago)296↓100%PHPPHP &gt;=7.0

Since Jul 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/zyimm/php-constants)[ Packagist](https://packagist.org/packages/zyimm/php-constants)[ RSS](/packages/zyimm-php-constants/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

php项目枚举常量配置管理&amp;调用包
=====================

[](#php项目枚举常量配置管理调用包)

安装

```
composer  require zyimm/php-constants
```

使用示例
----

[](#使用示例)

以一个简单流程配置为例:

```
class FlowConst extends \Zyimm\PhpConstants\Constants
{
    protected static array $status = [
        'wait'  => [
            'value' => 0,
            'title' => '待审核'
        ],
        'pass'  => [
            'value' => 1,
            'title' => '通过'
        ],
        'reject' => [
            'value' => 2,
            'title' => '拒绝'
        ],
        'cancel' => [
            'value' => 3,
            'title' => '已取消'
        ]
    ];

}
```

1.获取某个枚举数值

```
FlowConst::getValueByKey('wait', 'status'); // 1
FlowConst::getValueByKey('cancel', 'status'); // 0
```

2.获取枚举数值map

```
FlowConst::getMap('status');// [0=>'待审核', 1=> '通过' ....]
```

3.map转list

```
FlowConst::getMapList('status');
/**
* [
 * [
 *  'value' => 0,
 *  'title' => '待审核'
 * ],
 * [
 *  'value' => 1,
 *  'title' => '通过'
 * ]
 *
 * ]
*
*
 */
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

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

Total

3

Last Release

858d ago

### Community

Maintainers

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

---

Top Contributors

[![zyimm](https://avatars.githubusercontent.com/u/13979159?v=4)](https://github.com/zyimm "zyimm (11 commits)")

### Embed Badge

![Health badge](/badges/zyimm-php-constants/health.svg)

```
[![Health](https://phpackages.com/badges/zyimm-php-constants/health.svg)](https://phpackages.com/packages/zyimm-php-constants)
```

PHPackages © 2026

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