PHPackages                             tegic/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tegic/constants

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

tegic/constants
===============

注解 枚举类

v1.0(5y ago)04MITPHPPHP &gt;=7.1

Since Aug 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/teg1c/constants)[ Packagist](https://packagist.org/packages/tegic/constants)[ RSS](/packages/tegic-constants/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (2)Used By (0)

注解枚举类
=====

[](#注解枚举类)

```
composer require tegic/constants

```

使用
--

[](#使用)

定义

```
use tegic\Constants;

class Enum extends Constants
{
     /**
     * @Message("test")
     */
     CONST TEST = 1;
    /**
     * @Message("test1:%s,%s")
     */
     CONST TEST1 = 2;
}
```

使用

```
Enum::getMessage(Enum::TEST);
Enum::getMessage(Enum::TEST1,['1','2']);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

2097d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/27796058?v=4)[tegic](/maintainers/teg1c)[@teg1c](https://github.com/teg1c)

---

Top Contributors

[![teg1c](https://avatars.githubusercontent.com/u/27796058?v=4)](https://github.com/teg1c "teg1c (3 commits)")

---

Tags

enum

### Embed Badge

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

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

###  Alternatives

[myclabs/php-enum

PHP Enum implementation

2.7k227.9M637](/packages/myclabs-php-enum)[dasprid/enum

PHP 7.1 enum implementation

379146.0M11](/packages/dasprid-enum)[spatie/enum

PHP Enums

84429.1M68](/packages/spatie-enum)[marc-mabe/php-enum

Simple and fast implementation of enumerations with native PHP

49444.8M97](/packages/marc-mabe-php-enum)[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)[consistence/consistence

Consistence - consistent approach and additions to PHP's functionality

1831.1M18](/packages/consistence-consistence)

PHPackages © 2026

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