PHPackages                             phpyii/php-utils - 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. phpyii/php-utils

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

phpyii/php-utils
================

php积累的一些公用类方法

02PHP

Since Apr 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/phpyii/php-utils)[ Packagist](https://packagist.org/packages/phpyii/php-utils)[ RSS](/packages/phpyii-php-utils/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

php-utils
=========

[](#php-utils)

php积累的一些公用类方法

环境支持
====

[](#环境支持)

php版本 &gt;= PHP 7.1

安装
--

[](#安装)

```
composer require phpyii/php-utils

//开发版本
composer require phpyii/php-utils:dev-master

```

枚举类使用方法
=======

[](#枚举类使用方法)

```
 class  statusEnum extends \phpyii\utils\Enum{
      const VIEW = 'view';
      const EDIT = 'edit';

      protected static function labels(): array {
          return [
              self::VIEW => '视图',
          ];
      }

 }

 //枚举值
 $viewAction = statusEnum::VIEW();
 $viewAction->getValue();
 //或者
 statusEnum::VIEW;

 //获取枚举label
 statusEnum::getLabelByValue(statusEnum::VIEW);

 //获取枚举 值=>label数组
 statusEnum::toArray();
```

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

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.

### Community

Maintainers

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

---

Top Contributors

[![pgyf](https://avatars.githubusercontent.com/u/3365344?v=4)](https://github.com/pgyf "pgyf (13 commits)")

---

Tags

commonphpphp-utilsutils

### Embed Badge

![Health badge](/badges/phpyii-php-utils/health.svg)

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

###  Alternatives

[xpaw/php-minecraft-query

PHP library to query Minecraft servers

747107.4k3](/packages/xpaw-php-minecraft-query)[verbb/icon-picker

A slick field to pick icons from. Supports SVGs, Sprites, Webfonts, Font Awesome and more.

16170.9k7](/packages/verbb-icon-picker)[nilportugues/php_todo

Looks into the code using a user-defined list of to-do phrases and stops commit if the total amount increased or is above a threshold.

1210.0k](/packages/nilportugues-php-todo)

PHPackages © 2026

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